White space
free-form means we can write total code in a single line. like tab, space.
Identifiers
names used to classes, behaviors, variables.
uses numbers, dollar symbol, underscore, letters.
valid- Method, Addition1, run_any, $method.
invalid- 123.
Literals
A value of a corresponding variable.
example: 12,123.0.'r',"String".
Comments
the content ignored by the compiler which explains the operation of the program.
single line comment- // for line by line description.
multi line comment- /* */ for 3-4 lines description.
Documentation comment- in html document like /** */.
Separators
terminate the statements.
()- Parentheses--- to arguments, control statements like if, while, for.
[]-Brackets---- to declare size of arrays.
{}-Braces--- to define methods ,classes, automatic initialization of arrays.
,- comma--- to declare variables, in for loop.
;- semicolon---terminates the statements.
.- Period-- for packages, sub packages, references to class.
::- Colons--- Used to create a method or constructor reference
Keywords
totally 50 are there which are can not be used as variables, class names, method names.
Libraries
Java has built in class libraries that contain methods for IO operations, GUI, Networking, String handling etc which provides greater functionality to java.