What will be the output the below code when executed?

public class Tester {
public static void main(String[] args) {
int intValue = 100;
String strValue = "John";
float floatValue = 20.0f;

if (intValue > 100 || strValue == "John" && floatValue < 20.01f) {
System.out.println("if");
} else if (intValue >= 100 || strValue.endsWith("John") || floatValue < 21.01f) {
System.out.println("elseif-1");
} else if (intValue == 100 || strValue.startsWith("John") || floatValue > 19.01f) {
System.out.println("elseif-2");
} else {
System.out.println("else");
}
}
}

if

elseif-1

elseif-2

else

Verified Answer
Correct Option - a

To get all Infosys Certified Java SE8 Developer Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in