What is java Tokens ?
Java Token is nothing but some small unit of java which are used in every program.
There are different tokens are used in java such are :-
- Data types
It is a value or a constant which can’t be changed during the time of execution.
In java language there are different literals are used such as : –
- Interger Literal (A number without decimal point known as integer literal exp- 10, 14, 24, 54, 675 etc).
- Floating point literals (A number with decimal points known as Floating point literals exp- 8.73, 936.267, 34.32 etc. ).
- Character literals (Within the single quote what ever presents that’s are character literal exp- ‘7267’, ‘Kanhu’ ,’Kanhu143′ etc).
- String Literal (Within the single quote what ever presents that’s are character literal exp- “7267”, “Kanhu” ,”kanhu143″ etc).)
- Boolean Literal (The logical value “True” & “False” both are known as boolean literal ).
Variable is a name given to a particular memory location of the computer memory, where data will be stored. Without variable the data can’t accessible from the memory location.
Rules for Naming a variable
- The variable name must be started with either an alphabet or an underscore.
- Except underscore there are no other space or symbol can’t allow inside the variable name.
- No keyword as used as a variable.
- The variable name should be meaning-full.
Some pre-defined word are used in java for some specific purpose known as keyword or Reserved word. No keyword used as a variable.
Data type is used to represent the data in memory as a result the memory can be used in optimised way.
In java there are 2 types of data type used such as :- Primitive and another one is User-defined data types.
Primitive data types
Those data types are pre-defined to represent the data in memory known as primitive or pre-defined data types.
All the primitive data classified as :-
- Floating point