In this section we will learn about commenting in Java.
We will learn following things:
a) Identifiers in Java.
b) Object types in Java.
c) Code commenting in Java
d) Integer types in Java
e) Keywords in Java.
Following table shows all these things with relevant description.
TypesTypes are divided into two categories. There are 8 primitive types: boolean (true and false); char (Unicode characters); byte, short, int, and long (integers); float and double (floating point). Object types are created whenever a class is defined.
Integer TypesThe integer types byte, short, int, and long are stored as two's complement, signed binary integers. char, which is technically also an integer type, is stored as an unsigned binary number. Expressions are computed as ints, so a cast is needed to store in a smaller type.
Floating-point TypesThe floating-point types, float and double, are stored in IEEE-754 format. Calculations may produce NaN (Not a Number) or +/- infinity. Calculations are done as doubles, so a cast is needed to store in a float.
char Typechar type is a Unicode character stored as an unsigned number in two bytes (range 0..65,535 or '\u0000'..'\uFFFF'). char is an integer type.
boolean Typeboolean is used to store the values true or false. The storage is unspecified.
Operators: logical, ==, !=, assignment.
VariablesVariables may be local, instance (field), or static (class) variables. Formal parameters are local variables that are assigned values when the method is called.