Ask your own question, for FREE!
Computer Science 14 Online
OpenStudy (woodrow73):

Java: In.getInt() method... what is it?

OpenStudy (woodrow73):

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?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!