capture keyboard input

what is the object and method used to read user input from the keyboard when using the console window (java application)?

for example, i simple want to prompt the user for two int's i.e. length and width, assign the values to a variable and then calculate the area of a shape.

thx.

mc

[310 byte] By [coynerma] at [2007-11-26 16:37:30]
# 1
is the scanner class the most appropriate for this?System.out.println("Enter Length: ");length = keyboard.nextInt( );
coynerma at 2007-7-8 23:04:09 > top of Java-index,Core,Core APIs...
# 2
Read the "Scanning" and "I/O from the Command Line" topics here: http://java.sun.com/docs/books/tutorial/essential/io/index.html
ChuckBinga at 2007-7-8 23:04:09 > top of Java-index,Core,Core APIs...
# 3
chuck,thx for the reply...did i read this correctly that i can use the system class as following?int length:system.out.println("Enter length: ");system.in(length);
coynerma at 2007-7-8 23:04:09 > top of Java-index,Core,Core APIs...