Online Software Educational Training - IT Tutorials - Online Education Training for Computer Software


Home

JAVA PROGRAMMING

Lexical Issues 

Whitespace

Java is a free-form language. This means that you do not need to follow any special indention rules. In Java, whitespace is a space, tab, or newline.

Identifiers

Identifiers are used for class name, method names, and variable name. An identifier may be any descrptive sequence of uppercase and lowercase, numbers, or the underscore and dollor-sign characters. They must not begin with a number. 

Valid Identifiers

AvgTemp            count            a4            $text            emp_name

Invalid Identifiers

2count        high-temp        emp/name

The Java Keywords

absrtac const finally int public this
boolean continue float interface return throw
break default for long short throws
byte do goto native static transient
case double if new strictfp try
catch else implements package super void
char extends import private switch volatile
class final instanceof protected synchronized while

In addition to the keywords, Java reserves the following: true , false and null. These are values defined by Java. You may not use these words for the names of variables, classes, and so on.


Previous

Next