Java Type Casting
• Type casting is a way of converting
data from one data type to another data type. This process of data conversion
is also known as type conversion.
There are
two types of Casting in Java:
1) Widening Casting
2) Narrowing Casting
Widening
Casting: In
this type, Java automatically converts one data type to another data type.
Widening typecasting is also known as Implicit conversion or Casting down.
Narrowing Casting: In this type, the programmer manually converts one data type to another
datatype using Round brackets. Narrowing typecasting is also known as Explicit Conversion or Casting up.
Comments
Post a Comment