You are viewing a single comment's thread. Return to all comments →
Rather than a more effecient method, a simpler way is to use "nextLine" and parse out the integer and double.
ex:
int i = Integer.parseInt(scan.nextLine()); Double d = Double.parseDouble(scan.nextLine()); String s = scan.nextLine();
This way you don't have to worry about which line the Scanner is currently on.
Seems like cookies are disabled on this browser, please enable them to open this website
Java Stdin and Stdout II
You are viewing a single comment's thread. Return to all comments →
Rather than a more effecient method, a simpler way is to use "nextLine" and parse out the integer and double.
ex:
This way you don't have to worry about which line the Scanner is currently on.