Typecasting and Operators..
Typecasting and Operators..
COMPUTER PROGRAMMING 1
B y : Te l e s e r M e j o r a d a a n d F r e e c a
To r c u l a s
INTRODUCTION
W H AT I S T Y P E C A S T I N G ?
“()”
2
TWO TYPES OF
TYPECASTING
I M P L I C I T E X P L I C I T
byte -> short -> char -> int -> long double -> float -> long -> int
-> float -> double -> char -> short -> byte
For example For example
Int i = 10; Long L= 10000;
Long L= i; Int i = (int) L;
This is implicit casting This is Explicit Casting
“Implicit Casting is done by the Explicit Casting done manually by
compiler automatically” placing the type in parentheses in
front of the value. 3
I M P L I C I T E X P L I C I T
4
JAVA
OPERATORS
Operators are used to perform operations on
variables and values.
5
ARITHMET
IC
OPERATOR
S
6
JAVA
ASSIGNMEN
T
OPERATORS
7
JAVA
COMPARISO
N
OPERATORS
8
JAVA
LOGICAL
OPERATO
RS
9
JAVA
BITWISE
OPERATORS
10
THANK YOU FOR LISTENING