Question: What is the output of the following Java code fragment? int a = 5; int b = 10; int c = 20; boolean m =

What is the output of the following Java code fragment?

int a = 5; int b = 10; int c = 20;

boolean m = (a += 10) + 10 == c;

System.out.println(m);

if (a > b || b + 10 > c){

System.out.println("case 1");

} else if (a < b && b + 10 < c){

System.out.println("case 2");

} else if ( !(a + 20 > c) || a + 10 < b){

System.out.println("case 3");

} else {

System.out.println("case 4");

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!