Java Tokens
Java Tokens
– When more than one words are used in a name, the second and
subsequent words are marked with a leading uppercase letters.
• Examples: dayTemperature, firstDayOfMonth, totalMarks
– All private and local variables use only lowercase letters combined
with underscores
• Examples: length, batch_strength
– All classes and interfaces start with a leading uppercase letter and
each subsequent word with a leading upper case letter
• Examples: Student, HelloJava, Vehicle, MotorCycle
– Variables that represent constant values use all uppercase letters and
underscores between words.
• Examples: TOTAL, F_MAX, PRINCIPAL_AMOUNT
• 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 5 major types of literals.
• Integer literals
• Floating _point literals
• Character literals
• String literals
• Boolean literals
– Each of them has a associated type that describes
how the values behave and how they are stored.
• Operators
– Is a symbol that takes one or more arguments and operates on them
to produce a result.
• Separators
– Separators are symbols used to indicate where groups of code are
divided and arranged.
– They basically define the shape and function of our code.