HOT SPOTS
Sun Certified Programmer for the Java 2 Platform Quiz #2 (SCJP 1.4)
Page 7 of 31
Question 7:
What will happen when you attempt to compile and run the following code?
interface MyInterface
{
}
public class MyInstanceTest implements MyInterface
{
static String s;
public static void main(String args[])
{
MyInstanceTest t = new MyInstanceTest();
if(t instanceof MyInterface)
{
System.out.println("I am true interface");
}
else
{
System.out.println("I am false interface");
}
if(s instanceof String)
{
System.out.println("I am true String");
}
else
{
System.out.println("I am false String");
}
}
}
- Sun Certified Programmer for the Java 2 Platform Quiz #2 (SCJP 1.4)
- Question 2
- Question 3
- Question 4
- Question 5
- Question 6
- Question 7
- Question 8
- Question 9
- Question 10
- Question 11
- Question 12
- Question 13
- Question 14
- Question 15
- Question 16
- Question 17
- Question 18
- Question 19
- Question 20
- Question 21
- Question 22
- Question 23
- Question 24
- Question 25
- Question 26
- Question 27
- Question 28
- Question 29
- Question 30
- End of Quiz