Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 482 Bytes

File metadata and controls

20 lines (12 loc) · 482 Bytes

Type Casting in Java

There are two types of casting

  • Widening Casting
  • Narrowing Casting --> Needs to manually cast

From Left to Right of the following we don't need to cast anything

auto cast --> don't need to cast anything like: float(2)

manual cast <-- int(2.5)


byte short char int long float double
1 byte 2 bytes 2 bytes 4 bytes 8 bytes 4 bytes 8 bytes