Monday, 4 February 2013

Lexical Issues in Java

Java is a collection of white space, literals, identifiers, operators, comments, separators, and keywords.

White space
Java is a free-form language. This means that you do not need to follow any special indentation rules.

Identifiers
Identifiers are used for class names, variable names and method names. An identifier may be any sequence of upper-case and lower-case letters, numbers, or dollar-sign characters and the underscore. They must not begin with a number, and lest they be sometimes confused with a numeric literal. Well, as we know Java is case-sensitive, so writing "Value" is a different identifier than writing like this "VALUE". 

Literals
In JAVA, a constant value is created by using a literal representation of it.

Comments
As it is mentioned, there are three types of comments which are defined by Java. You have already seen two types: single-line and multi-line. The third and last type is called a documentation comment. Documentation comment is used to produce an Html file that documents your program.

Separators
In Java, there are a few characters that are used as separators. We have that the most commonly used separator in Java is the semicolon where it is used to terminate statements in JAVA programs.

The Java Keywords
There are 50 keywords which are currently defined in the Java. These keywords, combined with the syntax of the separators and operators, form the foundation of the Java. These keywords cannot be used as names for a class, method or variable.

No comments:
Write comments

Featured post

List of Universities in Karnataka offering M.Sc Computer Science

The post-graduate programme in Computer Science (M.Sc Computer Science) contains two academic years duration and having a four semesters....

Popular Posts

Copyright @ 2011-2016