shalinikarunakaran1
891 views
5 slides
Aug 26, 2021
Slide 1 of 5
1
2
3
4
5
About This Presentation
Java Tokens
Size: 60.79 KB
Language: en
Added: Aug 26, 2021
Slides: 5 pages
Slide Content
JAVA TOKENS
A Smallest individual units in a program are known as tokens Java Language includes five types of tokens they are: Reserved Keyword Identifiers Literals Operators Separators Keyword: Keywords are an essential part of a language definitions. These Keywords combined with operators and separators. All Keywords are written in lower-case letters. Java is case-sensitive.
Identifiers: Identifiers are programmer-designed token. They are used for naming classes, methods,variables,objects, labels,package and interface in a program. Rules of Identifiers: They can have alphabets, digits and the underscore and dollar sign characters. They must not being with a digit. Uppercase and lowercase letters are distinct. They can be of any length. Literals: Literals in java are a sequence of characters ( digits, letters, and other characters) that represent constant values to be stored in variables. Java language specifies five major types of literals they are: Integer literals Floating_point literals Character literals String literals Boolean literals
Operators: An Operator is a symbol that takes one or more arguments and operators. Separators: Separators are symbols used to indicate where groups of code are divided and arranged. Lists of separators: Parentheses (): It is used to call the functions and parsing the parameters. braces {}: The curly braces denote the starting and ending of a code. b rackets[]: U sed to declare array types and for dereferencing array values. Semicolon: Used to separate statements. Comma: It is used to separate two values, statements, and parameters. Period: It separates the package name form the sub-packages and class. It also separates a variable or method from a reference variable.