how to cast java code example
Example 1: cast java
JAVA: Example of cast:
int SomeNumber = 5; //int
double WideCastedNumber = (double)SomeNumber; //from int to double
double myDouble = 9.78;
int myInt = (int) myDouble; // from double to int
Example 2: typecasting java
Assigning a value of one type to a variable of another type is
known as Type Casting.
Auto-boxing; is a process when you take a primitive value and
assign into wrapper class object.
Un-boxing; is a process when you take Wrapper class object
and convert to primitive.