2.4.1.The Cast Operator (type) is for explicit conversion of a type.
public class MainClass { public static void main() {
// forcing a double value into an int variable like this: int diameter = 9; int circum = (int) (Math.PI * diameter);
System.out.println(circum);
}
}
28
2.4.Cast Operators
2.4.1.
The Cast Operator (type) is for explicit conversion of a type.