Prior to JDK 5.0, there was no Scanner class. Use JOptionPane.showInputDialog instead.
5.0
1.4
Scanner in = new Scanner(System.in);System.out.print(prompt);int n = in.nextInt();double x = in.nextDouble();String s = in.nextLine();
String input = JOptionPane.showInputDialog(prompt);int n = Integer.parseInt(input);double x = Double.parseDouble(input);s = input;