For each of the following series of types first provide the
For each of the following series of types first provide the java declaration syntax and then list atleast two different literal values:
integers
decimal real numbers
characters
boolean
For each of the following series of types first provide the java declaration syntax and then list atleast two different literal values:
integers
decimal real numbers
characters
boolean
For each of the following series of types first provide the java declaration syntax and then list atleast two different literal values:
integers
decimal real numbers
characters
boolean
Solution
The java declaration syntax for integers is
int variable_name;
The literal values for integers are decimal, octal and hexa decimal. The other literals are byte,short.
The java declaration syntax for decimal real numbers is
float variable_name;
or
double variable_name;
The literals for decimal real numbers is single precision and double precision.
The java declaration syntax for characters is
char variable_name;
The literals for characters are declared in single quotes like \'A\'. the character is represented in unicode and treated as 16-bit unsigned integers.
The java declaration syntax for boolean is
boolean variable_name;
The literals for boolean is true and false.
