indentations
The indentations keep the code clearly visible and easy to read.
The indentations keep the code clearly visible and easy to read.
import java.io.*; //printing a message on the screen //notice the format of the code public class HelloClass { public static void main (String[ ] args) { System.out.println ("Hello, Java world!"); System.out.println ("I plan to be a Java expert!"); } }
Case sensitivity:
Most Java code is written in smaller case and ALL reserved words (such as "if") MUST be written in smaller case.
Comments:
In Java, comments may be expressed in different forms.
The comments beginning with // are single line comments.
The comments enclosed within /* and */ are used for longer comments that wrap around a line.
The comments beginning with // are single line comments.
The comments enclosed within /* and */ are used for longer comments that wrap around a line.
Blank Space:
The compiler ignores extra blanks between words and symbols.
Blank lines between lines of code are also ignored.