Key words:
  • Integer.ParseInt. // parsing string input to integer

import java.io.*;
// javac simple_int.java
public class simple_int
{
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);
int n1 = Integer.parseInt(str);
//System.out.println();
System.out.println(n1 + n1);
}
}