V Việt Quân New member Sep 19, 2021 #1 What will be the output of the following Java code? Code: class operators { public static void main(String args[]) { int x = 8; System.out.println(++x * 3 + " " + x); } } A. 24 8 B. 24 9 C. 27 8 D. 27 9
What will be the output of the following Java code? Code: class operators { public static void main(String args[]) { int x = 8; System.out.println(++x * 3 + " " + x); } } A. 24 8 B. 24 9 C. 27 8 D. 27 9
M Mỹ Duyên New member Sep 19, 2021 #2 Answer: d Explanation: Operator ++ has higher precedence than multiplication operator, *, x is incremented to 9 than multiplied with 3 giving 27. output: Code: $ javac operators.java $ java operators 27 9 Upvote 0 Downvote
Answer: d Explanation: Operator ++ has higher precedence than multiplication operator, *, x is incremented to 9 than multiplied with 3 giving 27. output: Code: $ javac operators.java $ java operators 27 9