CERTIFICATION WATCH

Get the latest certification news by email!

*





*




Our Other Sites

GoExam: Certification practice tests with free demos to download.

GoTraining: Get Training on what you need.

CertificationBooks: Find the certification book you're looking for.

Free Tech Pubs: Free computer industry magazines, newsletters, and whitepapers.

SearchCertify: links, links and more certification links!


HOT SPOTS

Sun Certified Programmer for the Java 2 Platform Quiz #2 (SCJP 1.4)

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");
        }
    }    
}
A. Compile-time error
B. Runtime error
C. Prints : "I am true interface" followed by " I am true String"
D. Prints : "I am false interface" followed by " I am false String"
E. Prints : "I am true interface" followed by " I am false String"
F. Prints : "I am false interface" followed by " I am true String"

 
Follow GoCertify on Twitter