Blog Introductions

In this  blog contains tutorials about  HTML Tutorials, Python Tutorials, CSS Tutorials, How to, PHP Tutorials, Java Tutorials, C++ Tutorials, Tutorials,  Examples, Source code,Learning,
Tips and Software development  services. 
Java If-else control flow  | Java Tutorials Bestitworriors



 Java If-else control flow 

Java tutorials



Java If-else control flow  | Java Tutorials Bestitworriors - If-else contains the block of code that execute when certain condation is true.We use if-else for condation base code.If condation is true the execute the if block code otherwise we can have multiple else - if to check next condation is true then execute the code other wise if not any of condation match the execute the else block.


Some Key Points of Java If-else




  1. if-else use for condation base
  2. If condation is true the execute if-block code
  3. if condation is not true then check next else if condaton and execute etc.
  4. If none of condation is match then execute else block
  5. We use certein condation in if-else to check the condation
  6. Less than: a < b
  7. Less than or equal to: a <= b
  8. Greater than: a > b
  9. Greater than or equal to: a >= b
  10. Equal to a == b
  11. Not Equal to: a != b

Code


public


class if_elses {
public static void main(String[] args) {

int firstnum = 5;
int secondnum = 10;

if ( firstnum > secondnum)
{
System.out.println("First number is greater then second");

} else if (firstnum == secondnum)
{

System.out.println("First number is equal to second");

} else
{

System.out.println("First number is less then second");

}
}

}




OutPut


First number is less then  second



I hope You really enjoyed this blog . I try my best to make every thing is easy and helpfull to provide to public .You will get more blog about the Programing project and code . Thanks for visiting my blog if you have any querry related to this you can comment here i will try my best to response you back about Java If-else control flow  | Java Tutorials Bestitworriors