Question: Based on the following code what will be the output? * A. value1 is false * B. value1 is true value2 is false * C.

Based on the following code what will be the output? * A. value1 is false * B. value1 is true value2 is false * C. value1 is true value2 is true. * --------------------------------------------------------------------------------------------------------- * boolean value1 = true, value2 = false; if(value1 == true){ System.out.println("value1 is: " + value1); if(value2 = true){ System.out.println("value2 is: " + value2); } else{ System.out.println("value2 is: " + value1); } } else{ System.out.println("value1 is: " + value1); }

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!