Tuesday 10 January 2017

Lexical Issues in Java


Java programs is a collection of White spaces , Identifiers , comments , Literals , Operators , Separators and Keywords.

-White Spaces 

Java is a free form language. This means that you do not need to follow any special indentation rules. In java , white spaces is a space , tab or new line.

-Identifiers

Identifiers are used for class names , method names and variable names. An identifier may be any descriptive sequence of uppercase and lowercase letters , numbers or the underscore and dollar sign design.

-Literals

A constant value in java is created by using a literal representation of it. A literal can be used anywhere a value of its type is allowed.

-Comments

There are 3 types of comment in java. First is single line comment and the second one is multi line comment. The third type of comment is called documentation comment. It is used to produce an HTML file that documents your program. It begins with a/** and ends with a*/.

-Separators

 There are few symbols in java that are used as separators.The most commonly used separator in java is the semicolon ' ; '. some other separators are Parentheses '( )' , Braces ' {} ' , Bracket  ' [] ' , Comma ' , ' , Period ' . ' .

- Java Keywords

There are 49 reserved keywords currently defined in java. These keywords cannot be used as names for a variable , class or method.

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


Java Class Libraries

The java environment relies on several built-in class libraries that contain many built-in methods that provide support for such things as I/O , string handling , networking and graphics.

The standard class also provide support for windowed output. Thus java as a totality is a combination of the java language itself , plus its standard classes.

                                                             By: Knowledge Bits

1 comment:

Video of the Day

Contact us

Name

Email *

Message *