1.

What is the difference between token and block in Java program?

Answer»

Tokens:
Tokens are the various Java program elements which are identified by the compiler. A token is the smallest ELEMENT of a program that is meaningful to the compiler. ... Java Tokens are the smallest individual BUILDING block of a Java program. TheJava compiler uses it for constructing expressions and statements.

Block:
A block in Java is a group of ONE or more statements enclosed in braces. Ablock begins with an opening brace ({) and ends with a CLOSING brace (}). Between the opening and closing braces, you can code one or more statements. For example: { int i, J; i = 100; j = 200; } A block is itself a type of statement.



Discussion

No Comment Found