1. What is the output of the following Java code ? int a=3, b=-3, c=0; if (a > = c){ if (b != -3) System.out.println("X"); System.out.println("Z"); } System.out.println("Y"); else else Z X 2. The Java expression: (3+2)*4 Can be also written as: (3*4+2*4) Incorrect Correct 3. The following Boolean expression: (x || !x) Will always give : true false
H3-(1) Basic Java Syntax. (self learning quiz)
Introduction to Java
-You can add //comments for a better understanding. explanation throw
-Explanation through with answers.
-Please answer without abbreviation.
-Make it clean and clear typing/writing.
Thank you.
As per our guidelines, we are supposed to answer the first 3 questions of multiple-choice questions, please repost other questions as separate questions.
We are given Java code's snippets and based on the logic we are supposed to find out the output generated by them.
I have first explained the whole logic behind each output like what's the output and then why we got this particular output etc. Then I have also attached screenshots of the output code to verify the solution.
I hope the explanations help you understand the logic behind the codes given.
Step by step
Solved in 5 steps with 4 images