Micro Niche Builder
Closed Thread
Results 1 to 3 of 3

Thread: If else statments in JAVA

  1. #1

    Default They are paying. Minimum investment $0.1

    This program seems stable

    Upgrades 10 cents - $2000

    http://www.10cent2surf.com/?ref=740


  2. SEO Software

  3. #2

    Default If else statments in JAVA

    In JAVA, is it possible to create "If" statements with out having it followed by "else"?

    I know that "If" is usually followed by "Else" in programming but is there an exception in JAVA?

  4. #3
    Mr. BindasS ankur0412 is on a distinguished road ankur0412's Avatar
    Join Date
    Feb 2009
    Location
    India
    Posts
    717
    Thanks
    24
    Thanked 55 Times in 42 Posts
    Blog Entries
    2

    Default

    No it is not compulsory to put an else statement after an if command.
    eg.,

    if(condition)
    {
    //set of statements.
    }

    the else after this can be omitted.
    But if you are returning something in an if statement than you will require a else statement also. eg.,

    if(condition)
    {
    return 1;
    }
    else
    {
    return 0;
    }
    in this case, you cannot omit the else part of if-else statement.

Closed Thread

Tags for this Thread

Bookmarks

Posting Permissions

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