❮ Previous Next ❯

Java if statement :

The if statement is the java's conditional branch statement. The general form of if statement is :

if(condition)
statement ;
or
if(condition)
{
statement 1;
statement 2;
.
.
.
statement n;
}
if1

where the condition can be any expression that produces a value true or false. If the condition is true, the statement that follows the if is executed. Otherwise the statement will not execute.
Or, if it contains a block of statement, then if the condition is true then all the statements will execute, and if the condition is false then the control execute the second statement onwards.

Example

class IfDemo
{
public static void main(String[] args)
{
int a=15;
if(a<20)
System.out.println("JavaRace");
}
}
Output
JavaRace
❮ Previous Next ❯

Follow Us





  Tutorials

Popular Links

Contact Us

address Plot No-741,2ND Floor
Opp. Bhagabati Temple,Jayadev Vihar
      Bhubaneswar-751013
      Email: info@silantechnology.com
      Phone: 0674-2361252
address
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved