0 LIKES LikeUnLike
Given x = 1, y = 2, what is the output of the following code?if (x != y)System.out.print ("Statement 1. ");elseSystem.out.print ("Statement 2. ");System.out.print ("Statement 3. ");Answers are statements 1 & 3.Hmm, why is it statement 3? Is it because there is a semi-colon after the statement 2 so it prints out statement 3 as well? I think it should just print out statement 1 since x != y is true...
Tags:
Report (0) (0) | earlier
Latest activity: earlier. This question has 2 answers.