Monday, 8 August 2016

Tokens

1.       Tokens :
The smallest logical unit in java programming is called as “Lexeme”.
The collection of Lexemes come under a particular group called as token.
Ex:-

Q) Count the number of tokens and lexemes from the following instructions?
Ans):-
>>int a+b+c*d;
>>int, a, b, c, *,d, ;----à9 lexemes
>>int ---------àData type
>>a,b,c,d----àvariable
>>=,+,*,------àoperators
>> ;-----------àspecial symbol
---------------------------------------------------
Tokens -------à4 types of Tokens
--------------------------------------------------
In java, to prepare java applications, java has provided the following tokens
1.       Identifiers
2.       Literals
3.       Keywords/ Reserved Words
4.       Operators


No comments:

Post a Comment