Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By JosAH

Thread: if statement

  1. #1
    ark
    ark is offline Senior Member
    Join Date
    Apr 2015
    Posts
    288
    Rep Power
    6

    Default if statement

    Java Code:
    if (JF.ind!=10) {JF.label.setText("You should wright xml file");};
              String message="";
    In this code - Did I correctly defined if statement - as it doesnt works - are there correct brackets and semicolons.
    Java Code:
    And with break - is it right.
    if (JF.ind!=10) {JF.label.setText("You should wright xml file");
                             break;
    };
    or it should be like this:
    Java Code:
    if (JF.ind!=10) {JF.label.setText("You should wright xml file");
    };
    if (JF.ind!=10) break;
    //I do not create new topic for such simple question
    Last edited by ark; 11-10-2015 at 07:16 PM.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    14

    Default Re: If Statement

    Quote Originally Posted by ark View Post
    //I do not create new topic for such simple question
    Well, you did it again. Resurrected an 8 year old post. Yes you should start a new thread for this. You have also been told
    about this several times. I am not a moderator but I know the rules and if you keep on doing this you run the chance of being
    banned from the forum.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: if statement

    You need to study the tutorial and look at its examples of how to write code: The Really Big Index
    Find the link to the topic, click and study the contents.
    If you don't understand my response, don't ignore it, ask a question.

  4. #4
    ark
    ark is offline Senior Member
    Join Date
    Apr 2015
    Posts
    288
    Rep Power
    6

    Default Re: if statement

    I ask why this code do not works? I have studied a lot of tutorials and books.
    Should it be );}; -
    or );} -
    or )}

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: if statement

    why this code do not works?
    Please write a small, simple test program with the problem, compile it, copy the error messages and paste the code and the error messages here.

    Note the trailing - doesn't look right.
    If you don't understand my response, don't ignore it, ask a question.

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,422
    Blog Entries
    7
    Rep Power
    28

    Default Re: if statement

    Quote Originally Posted by ark View Post
    I ask why this code do not works? I have studied a lot of tutorials and books.
    Should it be );}; -
    or );} -
    or )}
    Sure, sprinkle in random brackets of all sorts; don't you think it's time for you to start reading the (basic) tutorials, instead of filling the forums here with questions you don't understand the answers of?

    Jos
    gimbal2 likes this.
    Build a wall around Donald Trump; I'll pay for it.

Similar Threads

  1. Replies: 5
    Last Post: 05-18-2014, 03:41 AM
  2. Statement and prepared statement
    By suhaas.mohandos@gmail.com in forum JDBC
    Replies: 10
    Last Post: 01-30-2014, 01:44 PM
  3. Replies: 3
    Last Post: 11-19-2012, 08:12 PM
  4. Replies: 2
    Last Post: 03-26-2012, 04:27 PM
  5. Statement or Prepared Statement ?
    By paty in forum JDBC
    Replies: 3
    Last Post: 08-01-2007, 04:45 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
  •