Java explicit casting

https‮/:‬/www.lautturi.com
Java explicit casting

Java Type Casting is classified into two types.

  • Narrowing Casting (Explicit) - Need Explicit Conversion
  • Widening Casting (Implicit) - Automatic Type Conversion

Explicit casting is manually casting a variable to another type

short s=1024;
int i;
i = (int) s;    // c-like cast notation
i = int (s);    // functional notation
Created Time:2017-09-05 14:04:09  Author:lautturi