Results 1 to 5 of 5
  1. #1
    rjagan's Avatar
    rjagan is offline Member
    Join Date
    Feb 2011
    Location
    Puducherry
    Posts
    53
    Rep Power
    0

    Post How to use label in java - i got error

    TEST:
    {
    read();
    read1();
    read2();

    if(value1>value2)
    {
    System..out.println("Pass");
    break TEST;
    }
    else
    { continue TEST; }
    }

    Hi friends..
    I got error undefined label TEST

    How can i use this label in my code..

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,988
    Rep Power
    9

    Default

    Continue cannot be used outside of a loop.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    rjagan's Avatar
    rjagan is offline Member
    Join Date
    Feb 2011
    Location
    Puducherry
    Posts
    53
    Rep Power
    0

    Post

    then how to write the above coding.. send the modification in above code

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default

    Labels also are loop related.
    There is no such thing as a goto (which is sort of what you're looking for).
    So presumably you should be writing a loop.

  5. #5
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,988
    Rep Power
    9

    Default

    Quote Originally Posted by rjagan View Post
    then how to write the above coding.. send the modification in above code
    See my signature. Politeness will get your far.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Replies: 1
    Last Post: 12-05-2009, 07:28 AM
  2. First SWT Label
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-11-2008, 04:38 PM
  3. Example of SWT Label
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-09-2008, 12:02 PM
  4. Using java.awt.Label
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-02-2008, 06:28 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
  •