Results 1 to 1 of 1
-
Reading a line from console using Scanner class
The static method belows reads a line from the console using Scanner class.
Java Code:public static String readLine() throws InputMismatchException { Scanner in = new Scanner(System.in); String str; System.out.println("Enter an integer value: "); str = in.nextLine(); return str; }
Similar Threads
-
Reading pattern using Scanner class
By Java Tip in forum Java TipReplies: 0Last Post: 01-18-2008, 12:02 PM -
Read from console (Scanner Class)
By hey in forum New To JavaReplies: 10Last Post: 12-11-2007, 10:11 PM -
Scanner class
By ajaymenon.k in forum Advanced JavaReplies: 1Last Post: 11-26-2007, 07:01 AM -
Reading in data from file line by line
By bluekswing in forum New To JavaReplies: 1Last Post: 10-02-2007, 12:19 AM -
JDK 5.0 Scanner Class
By Sircedric88 in forum New To JavaReplies: 3Last Post: 07-27-2007, 06:55 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks