Class
Class
Keywords:
1. How to use
2. Where to use
3. What is the purpose
In java, 53 keywords:
Reserved Keywords (3): true, false, null (default value for object reference)
Keywords(48):
Identifiers:
Literals:
int i2 = 0123; // Octal, its value must be prefixed with 0 and its range of digits( 0 to 7).
int i3 = 0xABC // Hexadecimal value prefixed with 0x and its range of digits( 0 to 9 and a/A to f/F).
char c1 = ‘a’;
Flow Control:
Syntax:
if(condition)
Block;
Syntax:
if(condition)
Block-1;
}
else
Block-2;
Syntax:
if(condition)
Block-1;
else if(con2)
Block-2;
else
Block-n
Syntax:
Initialization;
do
{
// do the task
++/--
}while(Con);
Syntax:
Initialization;
while(Con)
// do the task
++/--
Syntax:
continue: To skip the current iteration and continue with the next iteration.
1. In Java, the 1st letter of each word must be the capital letter for the class name.
Ex: StudentData, EmployeeDetails, etc.
2. In Java, the 1st letter from the 2nd word onwards must be the capital letter for the method name.
Ex: displayName(), sumOfNumbers() etc.
3. Every statement must end with a semicolon.
4.