Question: Java. The output is true. Can you justify the answer? public class If2 { static boolean b1, b2; public static void main(String [] args) {

Java. The output is true. Can you justify the answer?

public class If2 { static boolean b1, b2; public static void main(String [] args) { int x = 0; if (!b1) { if (!b2) { b1 = true; x++; if (5 > 6) { x++; } if (!b1) { x = x + 10; } else if (b2 = true) { x = x + 100; } else if (b1 | b2) { x = x + 1000; } } }

System.out.println(x);

} }

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!