Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 29, 2022 06:51 am GMT

What Are the Tokens In JAVA

What are the tokens in JAVA.
Tokens:- Tokens are the smallest unit of programming language which helps the the programmer to create instructions

Tokens are two types
1- Keyword:-
2- Identifier:-

Keyword:-

  1. compiler aware words are called keyword

  2. Keyword have predefine meaning and cannot be altered by programmer's

  3. All Keywords are written low case.

Identifier:- Identifier are the names given by the programmer to the members of java such as class name, method name, variable name, interfaces name, packages etc.

There are certain rule to follow while naming the identifiers
if the rules are not followed we get complie time error(rules are checked by complier)

Rules to name Identifier
1- An Indentifire cannot start with number
e.g 1Programm
Program1

2- Character spaces are not allowed while naming the identifiers
e.g My First Program
MyFirstProgram

3- Special character are not allowed while naming the Identifiers other than '$' and '_'
e.g $Programs
_Program

4- Keyword cannot be used in Place of Identifiers


Original Link: https://dev.to/roshan_100kar/what-are-the-tokens-in-java-3em6

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To