Values and Datatypes(notes)
Values and Datatypes(notes)
A–Z 65 – 90
a–z 97 – 122
blank space 32
These are some non-graphic characters which are used as commands to direct the cursor
while printing.
\ \ – to print backslash
A token is defined as each individual component of a java program. The various types of
tokens are:
(i) Literals
(ii) Identifiers
(iii) Assignments
(iv) Punctuators
(v) Separators
(vi) Operators
(vii) Keywords
(i) Literals – These are constants which remain fixed throughout the execution of the program.
Types of literals are :
(ii) Identifiers - These are used to represent a function name, class name or a variable. A variable
is represented by its data type.
int a = 10 Literal
Assignment operator
Identifier
Data type
(iii) Assignment - refers to storing a value in a variables using „ = ‟ symbol. Here, the symbol „ = ‟
acts as an assignment operator.
(iv) Punctuators – They are the punctuation signs used as special characters in java.
eg - ? . ;
(v) Separators – They are the special characters in java which are used to separate the variables
or the characters.
eg - , [ ] { } ( )
(vi) Operators – These are the symbols or signs used to specify the operations to be performed in
a java expression or statement.
eg – Arithmetical operators – + , - , / , *
(vii) Keywords – They are reserved words that carry special meaning for the system compiler.
eg – class, public
Data types are the types of data assigned to a variable for storage, to ensure optimum
utilisation of memory space.
eg – int, char
5. Difference between Primitive and Non-primitive data types ?
Primitive Non-primitive
1. These are built-in data types 1. These are collection of primitive
data types
2. These are independent 2. These are dependent on primitive
data types
3. eg – int, char, double 3. eg – class, array, interface
Declaration Initialization
1. declares the type of a variable 1. assigns or stores a specific value
to a variable
2. eg – int a; 2. eg – a = 5;
11. What is Type Conversion ? Explain the two types of conversion with example.
______________________