Given a sample code:
1 class Test3 {
2 public Integer showval;
3 public void methodOne() {
4 Integer i = new Integer(1);
5 showval = i;
6 methodTwo(i);
}
7 private void methodTwo(Integer val) {
8 val = val.intValue();
9 System.out.print(val + " ");
}
10 public static void main(String[] args) {
11 Test3 t = new Test3();
11 t.methodOne();
12 t.methodTwo(9);
}}
What will be the result? Choose the correct option?
(A) 1 9
(B) 9 1
(C) Compilation error at line no-5
(D) Compilation error at line no-8
(A)
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.