The if statement menu

User Tag List

Results 1 to 1 of 1
  1. #1
    Kevve's Avatar Banned
    Reputation
    20
    Join Date
    May 2007
    Posts
    151
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    The if statement

    What this does
    The if... statement is used to make decisions for your code's in Java.

    About
    I will be explaining about how the if... statement is one of the most used features of Java. It is basically the same in JavaScript to as it is in other programming languages. If you are new to programming in Java like me, you should focus your best time understanding how the if... statement works.
    Im still in training of Java but the more I do the better I am so lets not get in the way of "This is easy", yes it is, but what about the new-comers eh?

    You use the if... statement to make decisions for your program, think of it as if you were the father of your son(it). Your son won't know much about life so you have to show him the way. Make a wise DECISIONS for his future and that is where the DECISION role comes in.
    First I will show you how the if... statement is used(this is called a syntax, the structure of your code):

    PHP Code:
     if (condition) {
       
    statements
       

    The if keyword identifies this as an if... statement. The condition in the parenthesis ( ) is evaluated to determine if true, and if so then the statements inside the curly braces { } are executed(started, operating), otherwise they are skipped and the programs continues with the first line after the if... statement.



    An optional else... statement can be included with the if... statement as follows:

    PHP Code:
     if (condition) {
       
    statements
       
    }
     else {
       
    statements
       

    in this case, the statements inside of curly brackets { } after the else... keyword are executed(started, operating) if the condition of the if statement is false.

    Take a look at the conditions which shows the results expected from the if... statement for different conditions. In this example x and y are two variables that have been initialized to a value. If you've taken algebra courses or know some math about =, <, <=, >, & >= then you are ok when it comes to conditions.

    if... statement Results
    condition -=-=-=- returns true if
    x == y -=-=-=- x and y are equal
    x != y -=-=-=- x and y are not equal
    x > y -=-=-=- x is greater than y
    x >= y -=-=-=- x is greater or equal to y
    x < y -=-=-=- x is less than y
    x <= y -=-=-=- x is less than or equal to y

    Now above was just an example of how to use them solely. But do you know what they actually do now? Lets take a look at it deeper:

    == is equal to;
    != is NOT equal to;
    > is greater than;
    >= is greater OR equal to;
    < is lesser than;
    <= is lesser OR equal to;

    I did NOT make this tutorial. It was my friend. I'm just passing it on.

    The if statement

Similar Threads

  1. How to get to the outlands on a live blizzard server
    By Matt in forum World of Warcraft Exploits
    Replies: 4
    Last Post: 06-16-2006, 05:27 PM
  2. Block resurrection of the opposite faction in battle grounds
    By Matt in forum World of Warcraft Exploits
    Replies: 5
    Last Post: 06-08-2006, 03:19 AM
  3. You can still get to the airport :)
    By janzi9 in forum World of Warcraft Exploits
    Replies: 2
    Last Post: 03-27-2006, 01:25 PM
  4. Get on to where the Auction house people are!
    By janzi9 in forum World of Warcraft Exploits
    Replies: 0
    Last Post: 03-06-2006, 11:44 PM
  5. Ninja the Graveyard
    By Matt in forum World of Warcraft Guides
    Replies: 0
    Last Post: 03-03-2006, 11:51 PM
All times are GMT -5. The time now is 03:59 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search