关于147中的119?、126?、144?、
119. Which will declare a method that is available to all
members of the same package and can be referenced without an
instance of the class? //完全不明白,能说说具体的判断根据么??
A.abstract public void methoda();
B.public abstract double methoda();
C.static void methoda(double d1){};
D.public native double methoda(){};
E.protected void methoda(double d1){};
Given:
public class OuterClass {
private double d1 = 1.0;
//insert code here , line 2
}
You need to insert an inner class declaration at line2. Which
two inner class declarations are valid? (Choose Two) //判断选择的原因是什么??要是有什么关于inner class的点睛之处,方便的告诉一声
A.static class InnerOne {
public double methoda() {return d1;}
}
B.static class InnerOne {
static double methoda() {return d1;}
}
C.private class InnerOne {
public double methoda() {return d1;}
}
D.protected class InnerOne {
static double methoda() {return d1;}
}
E.public abstract class InnerOne {
public abstract double methoda();
}
144. Which statements about static inner classes are true? (Choose Two)
A. A static inner class requires a static initializer.
B. A static inner class requires an instance of the enclosing
class.
C. A static inner class has no reference to an instance of the
enclosing class.
D. A static inner class has access to the non-static members
of the outer class.
E. Static members of a static inner class can be referenced
using the class name of the static inner class.
我看的有两种答案,c d和c e ,改选哪个??
小弟知道学艺不精,恳请帮忙,谢了