English

Define the various TOKENS of JAVA.

Advertisements

Question

Define the various TOKENS of JAVA.

Definition
Advertisements

Solution

  1. Keywords: Keywords are reserved words that have predefined meanings in Java. They cannot be used as names of variables, classes or methods.
    Examples: int, float, class, public, if, else.
  2. Identifiers: Identifiers are user-defined names given to variables, classes, methods and other elements of a Java program.
    Examples: student, totalMarks, sum, display.
  3. Literals: Literals are fixed or constant values that are directly used in a Java program. They may represent numbers, characters, strings or Boolean values.
    Examples: 100, 25.5, 'A', "Java", true.
  4. Operators: Operators are special symbols used to perform arithmetic, relational, logical and other operations on variables and values.
    Examples: +, -, *, /, %, ==, &&, ||.
  5. Separators: Separators are special symbols used to separate or group different elements of a Java program.
    Examples: Parentheses ( ), braces { }, brackets [ ], semicolon ;, comma , and period ..
shaalaa.com
  Is there an error in this question or solution?
Chapter 3: Programming in Java (Review of Class XI Sections B and C) - EXERCISE [Page 98]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 3 Programming in Java (Review of Class XI Sections B and C)
EXERCISE | Q 15. | Page 98
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×