Presentation is loading. Please wait.

Presentation is loading. Please wait.

JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.

Similar presentations


Presentation on theme: "JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces."— Presentation transcript:

1 JAVA Tokens

2 Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.

3 Java Character set Characters are the smallest unit of java language. These are used to write java tokens. Java characters are defined by Unicode character set.

4 Java Tokens are Keywords Identifiers Operators Separators Literals.

5 Keywords Keywords are words which belong to java language. They have standard predefined meaning. These words should be used only for their intended purpose. The Keywords should be written in lowercase.

6 Some of the keywords are: For Do While Goto If Else Int Char Byte Switch Void Try Catch Public Protected Private Static Throws

7 Identifiers Identifiers are names given to classes, methods, variables, objects, arrays, packages and interfaces in a program. These are user defined names.

8 Rules for Identifiers Identifiers are formed with alphabets, digits, underscore and dollar sign characters. The first character must be an alphabet. They can be any length. They are case sensitive.

9 Literals Literals are names that represent constant values. A constant is a quantity that does not change during program execution.

10 Types of Literals Integer literals Floating point literals Character literals String literals Boolean literals

11 Operators An operator is a symbol which represents some operation that can be performed on data. There are eight operators in java.

12 Types of Operators Arithmetic operators Relational operators Logical operators Short hand assignment operators Increment and decrement operators Conditional operators Bitwise operators Special operators

13 Separators Separators are symbols which belong to java language. These are used to indicate where group of codes are divided and arranged.

14 Separators in java ( ) Parenthesis – used to enclose arguments { } braces – used to enclose block of codes. [ ] brackets – used in arrays ; Semicolon – used to separate statements, comma – used separate variables in declaration.. Period – used to separate package names from sub-packages and classes.

15 The End …… Thank You ……


Download ppt "JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces."

Similar presentations


Ads by Google