You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?
Which of the following code fragments inserted, will allow to compile?OuterInner publicclassOuter{publicvoid someOuterMethod(){//Line 5 }publicclassInner { }publicstaticvoid main(String[] argv){Outer ot = new Outer();//Line 10}}
which two code fragments will compile? Base interfaceBase{boolean m1 ();byte m2(short s);}
interface Base2 implements Base {}
abstract class Class2 extends Base { public boolean m1(){ return true; }}
abstract class Class2 implements Base {}
abstract class Class2 implements Base { public boolean m1(){ return (7 > 4); }}
abstract class Class2 implements Base { protected boolean m1(){ return (5 > 7) }}
Which three form part of correct array declarations?
public int a [ ]
static int [ ] a
public [ ] int a
private int a [3]
private int [3] a [ ]
public final int [ ] a
What is the prototype of the default constructor?Test publicclassTest { }
What is the most restrictive access modifier that will allow members of one class to have access to members of another class in the same package?
Which of the following is/are legal method declarations?
protected abstract void m1();
static final void m1(){}
synchronized public final void m1() {}
private native void m1();
Which cause a compiler error?
Which three are valid method signatures in an interface?
private int getArea();
public float getVol(float x);
public void main(String [] args);
public static void main(String [] args);
boolean setFlag(Boolean [] test);
You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?