Key words
  •  Parsing : Double.parseDouble(str);
  • Casting : int n1 = (int)d1;

import java.io.*;
// javac casting_integer.java
public class casting_integer
{
public static void main(String args[])throws IOException
{
/*this is a comment
compile as
javac multi_comment.java
call as java simple_comment */
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Type numbers only: ");
String str = "";
str = br.readLine();
System.out.println(str);
double d1 = Double.parseDouble(str);
System.out.println();
System.out.println(d1 += d1);
int n1 = (int)d1;
System.out.println("--data loss expected--due to casting--");
System.out.println(n1);
}
}

see integer to rounding up to the highest number.