티스토리 뷰

공부

[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

'공부' 카테고리의 다른 글

[Jenkins] build by curl parameters  (0) 2021.03.17
[Hive] CSV delimiter table  (0) 2021.03.14
[Spark] current_date() & current_timestamp()  (0) 2021.03.14
[Python] max float  (0) 2021.03.14
[Java] convert Map to List  (0) 2021.03.14
댓글