Results 1 to 2 of 2
- 05-18-2010, 11:23 PM #1Member
- Join Date
- Mar 2010
- Rep Power
dear professionals, please help me with this !!
Suppose you enter 34.3, the ENTER key, 57.8, the ENTER key, 789, the ENTER key. Analyze the following code.
Scanner scanner = new Scanner(System.in);
int value = scanner.nextDouble();
int doubleValue = scanner.nextInt();
String line = scanner.nextLine();
the answer is :
After the last statement is executed, line contains character '\n '
why ?????? please explain me with details,,, i really appreciate your help
- By wjcking in forum New To JavaReplies: 3Last Post: 03-10-2010, 05:51 PM
- By careertechy in forum Jobs OfferedReplies: 2Last Post: 01-15-2009, 12:40 PM
- By avularamesh4u in forum Jobs DiscussionReplies: 2Last Post: 12-30-2008, 05:05 PM
- By ioc_spring in forum IntroductionsReplies: 2Last Post: 08-25-2008, 12:07 PM
- By deepak_yoganishta in forum Jobs OfferedReplies: 0Last Post: 02-04-2008, 01:08 PM