A.Foo.beta()isavalidinvocationofbeta().
B.Foo.alpha()isavalidinvocationofalpha().
C.Methodbeta()candirectlycallmethodalpha().
D.Methodalpha()candirectlycallmethodbeta().
第1题:
1.publicinterfaceA{
2.publicvoiddoSomething(Stringthing);
3.}
1.publicclassAImplimplementsA{
2.publicvoiddoSomething(Stringmsg){}
3.}
1.publicclassB{
2.publicAdoit(){
3.//morecodehere
4.}
5.
6.publicStringexecute(){
7.//morecodehere
8.}
9.}
1.publicclassCextendsB{
2.publicAImpldoit(){
3.//morecodehere
4.}
5.
6.publicObjectexecute(){
7.//morecodehere
8.}
9.}
Whichstatementistrueabouttheclassesandinterfacesintheexhibit?()
第2题:
A.int foo() { /* more code here */ }
B.void foo() { /* more code here */ }
C.public void foo() { /* more code here */ }
D.private void foo() { /* more code here */ }
E.protected void foo() { /* more code here */ }
第3题:
A.publicvoidfoo(){/*morecodehere*/}
B.privatevoidfoo(){/*morecodehere*/}
C.protectedvoidfoo(){/*morecodehere*/}
D.intfoo(){/*morecodehere*/}
E.voidfoo(){/*morecodehere*/}
第4题:
A.intfoo(){/*morecodehere*/}
B.voidfoo(){/*morecodehere*/}
C.publicvoidfoo(){/*morecodehere*/}
D.privatevoidfoo(){/*morecodehere*/}
E.protectedvoidfoo(){/*morecodehere*/}
第5题:
A.public int compareTo(Object o){/*more code here*/}
B.public int compareTo(Score other){/*more code here*/}
C.public int compare(Score s1,Score s2){/*more code here*/}
D.public int compare(Object o1,Object o2){/*more code here*/}