11. What is the output of the following Java code ? int num=0; num--; System.out.println(num*-1); -1 1 00 12. What is the output of the following Java code ? int t=4; t=t*(t%2+6/12-30)-1; if (t>= -120) else System.out.print("G"); else if (t< -120) System.out.print("$"); System.out.print("&"); & S G 13. The following Java statement: X=X-1; Is equivalent to: x=1-x --X; ++X X=X+1:
H3-(2) Basic Java Syntax (self learning quiz)
Introduction to Java
-You can add //comments for a better understanding.
-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 3 images