Tutorialslot.com

youtube facebook twitter gmail pinterest

Lexical Issues in Java


Lexical Issues in Java:
The atomic elements of java are a collection of identifiers , comments , literals ,operators , whitespace , keywords and separators.
Identifiers:
Identifiers can be used for naming class,methods and variables.An identifier can be any numbers,underscore or any sequence of uppercase and lowercase letters or any dollar-sign characters.They must not begin with a number. Since Java is case-sensitive,ADD is a different identifier than add.

Comments:
comments are used just for understanding the program.The functions initialized in comments will not be executed.There are three types of comments defined by Java,single-line, multiline and documentation comment.The documentation comments are involved in producing an html file that documents the program.

Literals:
The creation of constant values in java is possible by using the literal representations.
For example,
17 94.6 'A' "Keep Smiling"

Here, the first literal specifies an integer(17), the next is a floating-point value(94.6), the third is a character constant(A), and the last is a string("Keep Smiling"). A literal can be used anywhere when a value of its type is allowed.

Whitespace:
Java is a free-form language. This means that you do not need to follow any special indentation rules. For instance, the firstprogram could have been written in one line or in any other different way you like to write , as long as there was at least one whitespace character between each token that was not already delineated by an operator or separator. In Java,whitespace is a space, tab, or newline.



Advertisement Powered By Google Adsense






IF YOU LIKE THIS TUTORIALS PLEASE SHARE

Share on whatsapp

POPULAR TAGS

Java java tutorials learn java java programming tutorial learn java online learning java professionals tutorials Multithreading Generics Object Oriented Language Methods Polymorphism Inheritance