Shortcut Navigation:

Static Void Main Quiz

Given class Base{ Base(){System.out.print("Base");} } public class Alpha extends Base{ public static void main(String[] args){ new Alpha(); new Base(); } } What is the result?

Which two allow the class Thing to be instantiated using new Thing( )? (Choose two.)

Given: class A { A( ) { } } class B extends A { } Which two statements are true? (Choose two.)

Given: public class Test { } What is the prototype of the default constructor?

Given: class Super { public float getNum( ) { return 3.0f; } } public class Sub extends Super { } Which method, placed after ‘public class Sub extends Super {‘, causes compilation to fail?

In which two cases does the compiler supply a default constructor for class A? (Choose two.)

What produces a compiler error?

Given: public class A{ void A() { System.out.println("Class A"); } public static void main(String[] args) { new A(); } } What is the result?

Given: public class ReturnIt { returnType methodA(byte x, double y) { return (long)x / y * 2; } } What is the narrowest valid returnType for methodA?

Given: public abstract class Test { public abstract void methodA(); public abstract void methodB() { System.out.println("Hello"); } } Which two changes, independently applied, allow this code to compile? (Choose two.)