public class UseScanner { public static void main(String[] args) { Scanner console = new Scanner(System.in); // read an integer from the user // "prompt" the user to enter a value System.out.print("How old are you? "); int x = console.nextInt(); System.out.println(x + " squared is " + (x * x)); System.out.print("What is your name? "); String name = console.next(); System.out.println("Hello, " + name + ", I can't believe you're only " + x + " years old!"); } }