Q52
What is the output for the below code? public class Test public static void main(String[] args) int i = 010; int j = 07; System.out.println(i); System.out.println(j);
A.
8 7
AnswerB.
10 7
C.
Compilation fails with an error at line 3
D.
Compilation fails with an error at line 5
E.
None of these
Answer: Option A
Solution
Answer: Option A
Solution:
By placing a zero in front of the number is an integer in octal form. 010 is in octal form so its value is 8