Consider the following Java code: public class MyClass { public static void main(String[] args) { int i
Fantastic news! We've Found the answer you've been seeking!
Question:
Consider the following Java code:
public class MyClass {
public static void main(String[] args) {
int i = 10;
Object obj = (Object) i;
System.out.println(obj.getClass());
}
}
What is the output of the program when it is run with java MyClass command using Java 8 or later?
A. class java.lang.Integer
B. class java.lang.Object
C. class java.lang.String
D. class java.lang.Boolean
E. Compilation error
Related Book For
Data Structures and Algorithms in Java
ISBN: 978-1118771334
6th edition
Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser
Posted Date: