There are majorly two types of languages. First one is Statically typed language where each variable and expression type is already known at compile time.Once a variable is declared to be of a certain data type, it cannot hold values of other data types.Example: C,C++, Java. Other, Dynamically typed languages: These languages can receive different data types over the time. Ruby, Python
Java is statically typed and also a strongly typed language because in Java, each type of data (such as integer, character, hexadecimal, packed decimal, and so forth) is predefined as part of the programming language and all constants or variables defined for a given program must be described with one of the data types.
Java has two categories of data:
- Primitive data (e.g., number, character)
- Object data (programmer created types)
Primitive data are only single values; they have no special capabilities. There are 8 primitive data types
boolean data type represents only one bit of information either true or false . Values of type boolean are not converted implicitly or explicitly (with casts) to any other type. But the programmer can easily write conversion code.