Results 1 to 4 of 4
  1. #1
    sara12345 is offline Member
    Join Date
    Dec 2009
    Posts
    59
    Rep Power
    0

    Default skip executing commands

    hello
    I want to skip executing some lines in method
    how can I do it??
    thanks

  2. #2
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by sara12345 View Post
    hello
    I want to skip executing some lines in method
    how can I do it??
    thanks

    if i have understand your question you can use comments, to skip single lines use // or for several lines use /* open comment to */ close comment. comments are ignored by the compiler and so they will be skiped.

  3. #3
    sara12345 is offline Member
    Join Date
    Dec 2009
    Posts
    59
    Rep Power
    0

    Default

    no I didn't mean that I I have if condition if the if condition is true then exit and stop executing next lines in the method

  4. #4
    StormyWaters is offline Senior Member
    Join Date
    Feb 2009
    Posts
    305
    Rep Power
    6

    Default

    A simple if statement should do the trick....

    Pseudocode:
    Java Code:
    boolean condition;
    if (!condition) {
          //Code that would be skipped if the condition is not met
    }
    Here's a link to the tutorial: The if-then and if-then-else Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)

Similar Threads

  1. CMD is not reading commands
    By colonial in forum Forum Lobby
    Replies: 1
    Last Post: 03-15-2010, 02:36 AM
  2. Replies: 1
    Last Post: 02-27-2010, 01:29 AM
  3. problems with executing unix commands
    By shanky in forum Advanced Java
    Replies: 1
    Last Post: 02-18-2010, 05:36 AM
  4. Low-level java commands
    By artemff in forum New To Java
    Replies: 8
    Last Post: 01-01-2010, 06:23 AM
  5. Scanner Skip
    By right2001 in forum New To Java
    Replies: 16
    Last Post: 04-17-2009, 03:08 AM

Posting Permissions

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