1b. Explain The Characteristics of The Given Java Token.
1b. Explain The Characteristics of The Given Java Token.
Character Literals
Literals which
stores
character
value
Boolean Liter Literals
als which
stores tru
e or false
Key Definitions/ Formulas
Constructors are used to
Token Meaning Example assign initial values to instance
variables of the class.
Keyw A variable int distance;
ord is a continue There are many types of
meaningfu break operators in java which are
l name of public given below:
data return Unary Operator,
storage do
location in while Arithmetic Operator,
computer for shift Operator,
memory. Relational Operator,
When Bitwise Operator,
using a Logical Operator,
variable
you refer
Ternary Operator
to memory and
address of Assignment
computer. Operator
byte 0 1 byte
short 0 2 byte
int 0 4 byte
long 0L 8 byte
Example:
Local Variables
Instance Variables
Static Variables
Array:
An array is a collection of similar types of data.
For example, if we want to store the names of 100 people
then we can create an array of the string type that can store
100 names.
String:
In Java, string is basically an object that represents sequence
of char values. An array of characters works same as Java
string. For example:
char[] ch={‘M’,’S’,’B’,’T’,’E’};
String s=new String(ch);