import java.io.*; class floattolong { public static void main(String[] args) { try { // Reads the value from console BufferedReader buffreader = new BufferedReader(new InputStreamReader(System.in)); System.out.println("---Data Conversion from float type to long type---"); System.out.println("Enter float type value: "); // Read float type data float myfloat = Float.parseFloat(buffreader.readLine()); // Convert float type data to long type long mylong = (long)(myfloat); System.out.println("Converted value from float type to long type is : " + mylong); } catch (Exception e) { System.out.println(" Error " + e); } } }