Java: In.getInt() method... what is it?
I've seen the In.getInt() method used in multiple places in order to get user input, though have been seemingly unable to use it myself.. Here is an example of it in use: class Interactive { public static void main (String [] args) { // obtain name and age System.out.println("What is your first initial?"); char firstInitial = In.getChar(); System.out.println("What is your family name?"); String familyName = In.getString(); System.out.println("What is your age in years?"); int age = In.getInt(); // respond to input System.out.println("Well, " + firstInitial + "." + familyName + " - " + "I see that your age is " + age); } } though it doesn't seem to compile at at all, with an error message that says "In cannot be resolved" Any idea how I can use it?
Join our real-time social learning platform and learn together with your friends!