How to convert double to float in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        double d = 1923534.8915;

        float f = (float)d;
        System.out.println(f);	
    }
}




/*
run:

1923534.9

*/

 



answered Mar 17, 2021 by avibootz
...