공부
[Java] Double.intValue()
승가비
2021. 3. 14. 04:50
728x90
Double d = 5.25;
Integer i = d.intValue(); // i becomes 5
stackoverflow.com/questions/9102318/cast-double-to-integer-in-java/9102359
Cast Double to Integer in Java
Any way to cast java.lang.Double to java.lang.Integer? It throws an exception "java.lang.ClassCastException: java.lang.Double incompatible with java.lang.Integer"
stackoverflow.com
728x90