Java Tokens

0
Share

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 :-

  • Literal
  • Variable
  • Keywords
  • Data types
  • Operators
  • Identifiers

Literals

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

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.

Keywords

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 types

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 :-

  • Interger
  • Floating point
  • Character
  • Boolean

Read more post

  • What are the List of CSS3 New Features ?
    CSS3 is the latest version of the normal CSS . CSS3 adds several new styling features and improvements to enhance the web presentation capabilities. Text Effect in...
  • CSS Basic Property
    What is CSS ? CSS stands for Cascading Style Sheets. CSS basically used in designing the web tags & pages. CSS is the most popular used...
  • Java Program to swap two number use 3rd variable
    In this program, you’ll learn to Program to swap 2 number with 3rd variable in Java. After write the code, the final output is displayed on...
  • Java program to multiply two floating point number
    In this program, you’ll learn to Program to multiply two floating point number in Java. After write the code, the final output is displayed on the...
  • Java Program to find the ASCII value of a character
    In this program, you’ll learn to Program to find the ASCII value of a character in Java. After write the code, the final output is displayed...
  • Java Program to calculate quotient & reminder
    In this program, you’ll learn to Given Number is even or odd in Java. After write the code, the final output is displayed on the screen....
%d bloggers like this: