Concepts and Datatypes - Theory
Concepts and Datatypes - Theory
- Roopesh Saigaonkar
UNICODE ADVANTAGE
• Universal coadding scheme
• Coadding is unique so one code will never be given to more than one character
- Roopesh Saigaonkar
ASCII CHARACTERS
A M ER ICAN STA NDA R D CO DE FO R I NFO R M ATI ON I NT ER CH A NG E
• A – Z : 65-90
• a – z : 97-122
• 0 -9 : 48 -57
• Spacebar : 32
- Roopesh Saigaonkar
UNICODE VS ASCII
UNICODE ASCII
Coadding scheme for numerous characters of Coadding scheme for limited characters
different scripts
It Ranges from 0x0000 upto 0xFFFF if is 16-bits It’s range is only 7 binary bits that is 128 characters
(aprox ; 1,60,755 characters) from 0-127
- Roopesh Saigaonkar
ESCAPE SEQUENCE
• non graphic characters, which are used as commands to direct the
cursor while printing
Advait\Hemang
- Roopesh Saigaonkar
TOKENS
Eg int a = b + 5 ;
- Roopesh Saigaonkar
•Literals
•Identifier
•Operators
•Separator and Punctuators
•Keywords
- Roopesh Saigaonkar
LITERALS
Defination : Constants used in Java, which remains fixed trough out the program
• Arithmetical operator : + - * / %
• Relational Operator : > < >= <= = = !=
• Logical Operator : && || !
• Assingment Operator :=
• Unary , Binary , Ternary (Studied Further in details )
- Roopesh Saigaonkar
•2+4= 6
•2.5+2.5=5.0
•2+2.0=4.0
- Roopesh Saigaonkar
TYPES OF EXPRESSION
Mixed Pure Expression
Expression with more Expression with one data
than one data type type
Type conversion takes Pure expression doesn’t
place fallow type conversion
int a=5; int a=5;
float b=10.0f; int b=10;
System.out.println(a+b); System.out.println(a+b);
• Examples
2 + 3.5f = 5.5 //mixed float
2.5f+ 2.0=4.5 //mixed double
(int)2.5f+ (int)2.0=4
2+(int)2.5=4
- Roopesh Saigaonkar
TYPES OF EXPRESSION
Coercion Type casting
Also called implicit type Also called as explicit type
conversion conversion
Automatic conversion to Manual conversion of
higher data type particular data type
It is done automatic Needs users intervention
int a=5; int a=5;
float b=10.0f; float b=10.0f;
System.out.println(a+b); System.out.println((int)(a+b));