A comment is a note written to a human reader of a program. The program compiles and runs exactly the same with or without comments. Comments start with the two characters ―// (slash slash). Those characters and everything that follows them on the same line are ignored by the java compiler. everything between the two characters ― /*and the two characters ― */ are unobserved by the compiler. There can be many lines of comments between the ―/* and the ― */.
Literals in Java are a sequence of characters (digits, letters and other characters) that characterize constant values to be stored in variables. Java language specifies five major types of literals are as follows:
1. Integer literals
2. Floating point literals
3. Character literals
4. String literals
5. Boolean literals
Identifiers are programmer-created tokens. They are used for naming classes, methods, variables, objects, labels, packages and interfaces in a program. Java identifiers follow the following rules: 1. They can have alphabets, digits, and the underscore and dollar sign characters.
2. They must not start with a digit.
3. Uppercase and lowercase letters are individual.
4. They can be of any length.
Identifier must be meaningful, easily understandable and descriptive. Private and local variables like ―width. Name of public methods and instance variables begin with lowercase letter like ―multi.
Keywords are important part of Java. Java language has reserved 50 words as keywords. Keywords have specific meaning in Java. We cannot use them as variable, classes and method. Following table shows keywords. Examples of keywords are the primitive types, int and boolean; the control flow statements for and if; access modifiers such as public, and special words which mark the declaration and definition of Java classes, packages, and interfaces: class, package, interface. Below are all the Java language keywords: