int casting java code example
Example 1: java casting to int
//In java, you can cast to any primitive type by putting (primitiveType)
//before whatever you're casting to.
private static int myInt = (int)myDouble;
Example 2: 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