Java Conditional Statements Explained

Day 9:- Conditional Statements A Journey with Frontlines EduTech (FLM) and Fayaz S Conditional statements 👉 if- else If -else is a conditional statement used to execute different blocks of code base on a condition. if statement:- -- It excute code only if the condition is true -- if the condition is true.it prints the message -- id false nothing happens Example:- { int age = 18; if(age >=18); System.out.println("he is major"); } If-else :- It executes one block if the condition is true and another block if it is false. Syntax:- if(condition){ System.out.println(block); } else{ // else block } if-else-if:- It is used multiple conditions are checking. Syntax:- if(condition) { // Code } else if(condition 2) { // Code } else { // Code } #Corejava #ConditionalStatements #java #frontlinesmediaedutech

  • graphical user interface

To view or add a comment, sign in

Explore content categories