Menu
Question Index
...

What will be the output of the following program?

class IfExample
{
    public static void main(String s[])
    {
        if( 1 < 2 )
        {
            System.out.println("1 is less than 2");
        }
        else
            System.out.println("2 is less than 1");
            System.out.println("Hello From IfExample");
        
    }
}


1 is less than 2
Hello From IfExample
1 is less than 2
2 is less than 1
Compilation Error

Doubts

Problems

Topic: if Condition In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App