Results 1 to 2 of 2
  1. #1
    javanew is offline Member
    Join Date
    Mar 2010
    Posts
    49
    Rep Power
    0

    Default 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

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Multiposted and definitely not an advanced Java question. closed.

Similar Threads

  1. Replies: 3
    Last Post: 03-10-2010, 06:51 PM
  2. Opening for java Professionals
    By careertechy in forum Jobs Offered
    Replies: 2
    Last Post: 01-15-2009, 01:40 PM
  3. Great Demand For IT Professionals.
    By avularamesh4u in forum Jobs Discussion
    Replies: 2
    Last Post: 12-30-2008, 06:05 PM
  4. Hello to JAVA Professionals
    By ioc_spring in forum Introductions
    Replies: 2
    Last Post: 08-25-2008, 01:07 PM
  5. Requirement for Technical Professionals
    By deepak_yoganishta in forum Jobs Offered
    Replies: 0
    Last Post: 02-04-2008, 02:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •