Exam Permalink:
https://www.jobilize.com/java-certification-questions
Question Permalink:
https://www.jobilize.com/how-to-compare-between-java-wrappers
Question 133 / 297:  Given the following code fragment, what is true about the following System.out statements?
public class Tester {

public static void main(String[] args) {

Integer[][] arr1 = { { 1, 2 }, { 3, 4 } };

Number[] arr2 = arr1[0];

int x = 1;

System.out.print(arr1[0][0] == 1);

System.out.print(arr2[0] == x);

System.out.print(x instanceof Integer);

System.out.print(arr1[1][0] > (Integer) arr2[0]);

}

}

A  All statements will compile
B  Only one will compile and will print true
C  Only two statements will compile and both will print ture
D  Only three statements will compile, only two of them will print true
<< First < Previous Next > Last >>
Explanation:

arr2[0]==x will not compile because of incompatible operand types (Number and int)

x instanceof Integer will not compile because of incompatible conditional operand types (int and Integer)

Exam Home Page
https://www.jobilize.com/java-certification-questions

Oracle Certified Professional Java Programmer

Author:

Access: Public Instant Grading

Ask
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/java-certification-questions" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>