Jump to content

6 posts in this topic

Recommended Posts

Posted

If & If-Else Statements 

 

An If Statement is a conditional statement. This basically means that if the program is allowed to execute a specific set of instructions, it will but, only if that condition is met. If that condition is not met the program skips over the instructions. 

An example of an If Statement is as followed:

 

public class Test {

   public static void main(String args[])
{
      int x = 15; \\initialzes an integer (x) to 15

      if( x < 20 ) {
         System.out.print("This is if statement"); \\this prints if x is less than 20
                
    			   }
                
 }
 }

 

An If-Else Statement works very similarly to an If Statement. The only major difference is that if your 'if' is NOT met it goes to 'else' and runs that code in the program. Instead of skipping over the conditional.

An example of an If-Else Statement is as followed:

public class Test {

   public static void main(String args[]) {
      int x = 30; \\like before, declares integer to a value. In this case 30

      if( x < 20 ) { //if x is less than 20 (it is not) it will run the if-clause
         System.out.print("This is if statement");
         }
         else{ // if the x is greater than 20 (in this situation) it runs the else-clause
         System.out.print("This is else statement");
      }
   }
}

 

 

Some very common errors in If  and If-Else Statements could be the following:

 

if (yourCondition); \\<< IF YOU PUT A SEMICOLON HERE IT ENDS THE STATEMENT WITHOUT READING THE ACTUAL STATEMENT
{
//code here
}

That code will result in an error!

 

 

-LifeElevated

  • Like 1
Posted
5 hours ago, LifeElevated said:

I did lol . Did you mean to say something different?

I mean you're showing if statements bases on one condition only so if{} else {} but you couls try putting

If

Else if

Else if

Else

 

So they understand they can use multiple conditions ;)

Posted
1 minute ago, Crypto said:

I mean you're showing if statements bases on one condition only so if{} else {} but you couls try putting

If

Else if

Else if

Else

 

So they understand they can use multiple conditions ;)

no u

Posted (edited)
On 5/15/2018 at 2:54 PM, Crypto said:

I mean you're showing if statements bases on one condition only so if{} else {} but you couls try putting

If

Else if

Else if

Else

 

So they understand they can use multiple conditions ;)

You could also put nested if's but those are more complex so I left them out.

if{

else{ 

if

}

}

if{}

 

Updated by LifeElevated
  • Our picks

    • SuperStar STARSHIP Cheats v3.26.5 +3
      Modded/Hacked App: SuperStar STARSHIP By Dalcomsoft Inc.
      Bundle ID: com.dalcomsoft.sss
      iTunes Store Link: https://apps.apple.com/us/app/superstar-starship/id1480181152?uo=4


      Hack Features:
      - Never Lose
      - Auto Dance
      - Always S.Perfect


      iOS Hack Download Link: https://iosgods.com/topic/164185-superstar-starship-cheats-v378-3/
      • 133 replies
    • Last Survivor: Fantasy Land v1.0.44 [ +15 Cheats ] Currency Max
      Modded/Hacked App: Last Survivor: Fantasy Land By Fansipan Limited
      Bundle ID: com.fansipan.survivor.roguelike.casual.game
      App Store Link: https://apps.apple.com/us/app/last-survivor-fantasy-land/id6578445539?uo=4


      🤩 Hack Features

      - ADS NO [ Rewards Free ]

      - Gems

      - Coins

      - Energy

      - Keys
      • 4 replies
    • Last Survivor: Fantasy Land v1.0.44 [ +15 Jailed ] Currency Max
      Modded/Hacked App: Last Survivor: Fantasy Land By Fansipan Limited
      Bundle ID: com.fansipan.survivor.roguelike.casual.game
      App Store Link: https://apps.apple.com/us/app/last-survivor-fantasy-land/id6578445539?uo=4
       

      🤩 Hack Features

      - ADS NO [ Rewards Free ]

      - Gems

      - Coins

      - Energy

      - Keys
      • 5 replies
    • Heroes Crew: Strategy Defense v1.3.5 [+10 Cheats]
      Modded/Hacked App: Heroes Crew: Strategy Defense By AlohaFactory
      Bundle ID: com.overdogs.heroes
      App Store Link: https://apps.apple.com/us/app/heroes-crew-strategy-defense/id6744350078?uo=4



      🤩 Hack Features

      - Add Currency
      - Unlimited Items
      - Unlimited Property (Heroes, Relic etc)
      - Activate VVip (Use after tutorial and only in main menu)
      - Activate Premium Hunt Pass (Use after tutorial and only in main menu)
      - Unlimited Battle Currency (Always Will Increase)
      • 85 replies
    • Heroes Crew: Strategy Defense v1.3.5 [+10 Jailed Cheats]
      Modded/Hacked App: Heroes Crew: Strategy Defense By AlohaFactory
      Bundle ID: com.overdogs.heroes
      App Store Link: https://apps.apple.com/us/app/heroes-crew-strategy-defense/id6744350078?uo=4



      🤩 Hack Features

      - Add Currency
      - Unlimited Items
      - Unlimited Property (Heroes, Relic etc)
      - Activate VVip (Use after tutorial and only in main menu)
      - Activate Premium Hunt Pass (Use after tutorial and only in main menu)
      - Unlimited Battle Currency (Always Will Increase)
      • 44 replies
    • Dopamine Hit Cheats v3.4.1 +5
      Modded/Hacked App: Dopamine Hit By Mobigames INC.
      Bundle ID: com.mobigames.fakeroem
      App Store Link: https://apps.apple.com/us/app/dopamine-hit/id6736514242?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - God Mode
      - Multiply Attack
      - No Skills Cooldown
      - Freeze Currencies
      - PREMIUM

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/196879-dopamine-hit-cheats-v2120-5/
      • 39 replies
    • Hunt Royale: Action RPG Battle v3.15.2 +3 Jailed Cheats [ Damage & Defence ]
      Modded/Hacked App: Hunt Royale: Action RPG Battle By BoomBit, Inc.
      Bundle ID: com.hunt.royale
      iTunes Store Link: https://apps.apple.com/us/app/hunt-royale-action-rpg-battle/id1537379121?uo=4

       
       

      🚀 Hack Features

      - Dumb Enemies

      VIP
      - Damage Multiplier
      - Defence Multiplier
      • 180 replies
    • Enter the Gungeon v1.12 +8 Jailed Cheats [ Damage & Defence ]
      Modded/Hacked App: Enter the Gungeon By Devolver Digital, Inc.
      Bundle ID: com.devolverdigital.enterthegungeon
      App Store Link: https://apps.apple.com/us/app/enter-the-gungeon/id1100429641?uo=4

       


      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      - God Mode
      - Speed Multiplier
      - Free In-App Purchases
      - Unlimited Ammo
      - Add 1000 Hegemony Credits -> Pause the game, head into Options and toggle the Reset Defaults button.*
      - Add 1000 Shells -> Pause the game, head into Options and toggle the Reset Defaults button.*

      * - Only enable 1 feature at a time.
      • 16 replies
    • Enter the Gungeon v1.12 +8 Cheats [ Damage & Defence ]
      Modded/Hacked App: Enter the Gungeon By Devolver Digital, Inc.
      Bundle ID: com.devolverdigital.enterthegungeon
      App Store Link: https://apps.apple.com/us/app/enter-the-gungeon/id1100429641?uo=4

       
       

      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      - God Mode
      - Speed Multiplier
      - Free In-App Purchases
      - Unlimited Ammo
      - Add 1000 Hegemony Credits -> Pause the game, head into Options and toggle the Reset Defaults button.*
      - Add 1000 Shells -> Pause the game, head into Options and toggle the Reset Defaults button.*

      * - Only enable 1 feature at a time.
      • 3 replies
    • Hunt Royale: Action RPG Battle v3.15.2 +3 Cheats [ Damage & Defence ]
      Modded/Hacked App: Hunt Royale: Action RPG Battle By BoomBit, Inc.
      Bundle ID: com.hunt.royale
      iTunes Store Link: https://apps.apple.com/us/app/hunt-royale-action-rpg-battle/id1537379121?uo=4

       


      🚀 Hack Features

      - Dumb Enemies

      VIP
      - Damage Multiplier
      - Defence Multiplier
      • 35 replies
    • Royal Kingdom v20894 +4 Jailed Cheats [ Coins + More ]
      Modded/Hacked App: Royal Kingdom By Dream Games
      Bundle ID: com.dreamgames.royalkingdom
      iTunes Store Link: https://apps.apple.com/ph/app/royal-kingdom/id1606549505
       

      Hack Features:
      - Freeze Coins
      - Freeze Lives
      - Freeze Boosters
      - Freeze Moves


      Jailbreak required hack(s): [Mod Menu Hack] Royal Kingdom v3987 +4 Cheats [ Unlimited Coins ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 147 replies
    • Royal Kingdom v20894 +4 Cheats [ Coins + More ]
      Modded/Hacked App: Royal Kingdom By Dream Games
      Bundle ID: com.dreamgames.royalkingdom
      iTunes Store Link: https://apps.apple.com/ph/app/royal-kingdom/id1606549505
       

      Hack Features:
      - Freeze Coins
      - Freeze Lives
      - Freeze Boosters
      - Freeze Moves


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Royal Kingdom v3987 +4 Jailed Cheats [ Unlimited Coins ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 103 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines