Professional Documents
Culture Documents
Tokens Java
Types of Tokens
Literals
Punctuators
Identifiers Separators
Assignments
Operators
TOKENS
A = B + 10 ;
ID AS PU
IDE OP
EN SIG LIT NC
NTI ER
TI NM
FIE
ER TU
EN AT
FI R AL AT
T OR
ER OR
Literals
INTEGER CHARACTER
Literals
LITERALS LITERALS
BOOLEAN
NULL LITERALS LITERALS
Integer Literals
It is represented as /0
String terminator
Marks the end of the string
Punctuators
Non-graphic characters
They cannot be typed directly from the
keyboard
Begins with a \ followed by one of two
characters
\r - horizontal tab
\v - vertical tab
\b - backspace
Operators
Symbols or tokens
Performs arithmetic or logical
operations
Three types
Arithmetic Operator( +, - , *, /)
Relational Operator(< ,> , <=, >=,
==, <>)
Logical operator ( &&, ||,!)
Data types in Java
INTEGER
S
FLOATING
NUMBER
S
CHARACTERS
BOOLEAN
STRING
Primitive type
Independent on any other type
They are Basic data types
EG: byte,int,long,float, double
NON-Primitive
Derived data types
Directly or indirectly dependent on
primitive data type
They store data data with reference to
the address of locations
They are also called REFERENCE DATA
EG: arrays,classes,interface etc
Initializing a variable
static
Rules for naming a variable