Results 1 to 2 of 2
  1. #1
    robocop is offline Member
    Join Date
    Feb 2009
    Posts
    14
    Rep Power
    0

    Cool println question

    What would that output from the following be:

    Java Code:
      boolean continue = true;
      int count = 0;
      int max = 20;
      while (continue)
      {
          System.out.println (count);
          count++;
          max++;
          if (count > 10 && max > 40)
          continue = false;
      }
    what does it print out?

  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    7

    Default

    no output...
    "continue" is reserved by java...
    cant use as variable name

    if you modify the variable name
    it should output
    0
    1
    ...
    20

    but why do not you compile it and run it?

Similar Threads

  1. Need help with println
    By jhetfield18 in forum New To Java
    Replies: 8
    Last Post: 09-18-2009, 09:26 AM
  2. difference between system.out.println() & out.println()
    By wickedrahul9 in forum Advanced Java
    Replies: 5
    Last Post: 10-19-2008, 12:06 AM
  3. System.out.println
    By Sniper-X in forum Advanced Java
    Replies: 10
    Last Post: 05-05-2008, 04:41 PM
  4. System.out.println
    By sunjavaboy in forum Advanced Java
    Replies: 3
    Last Post: 03-22-2008, 02:30 AM
  5. Help me with system.out.println
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 09:30 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
  •