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 #1

Question 12:

What will happen when you attempt to compile and run the following code?

class Base 
{
    int i = 99;
    public void amethod()
    {
        System.out.println("Base.amethod()");
    }
            
    Base()
    {
        amethod();
    }
}
public class Derived extends Base
{
    int i = -1;
        
    public static void main(String argv[])
    {
        Base b = new Derived();
        System.out.println(b.i);
        b.amethod();
    }
    
    public void amethod()
    {
        System.out.println("Derived.amethod()");
    }
}
A. Derived.amethod()
    -1
    Derived.amethod()

B. Derived.amethod()
    99
    Derived.amethod()

C. 99
    Derived.amethod()
    Compile time error

 

 
Follow GoCertify on Twitter