- 16
- 0
- 约8.51千字
- 约 9页
- 2020-08-21 发布于河北
- 举报
一.Whichtwo demonstrate an “is a” relationship? (Choose Two)
A.public interface Person{ }//语法错了
public class Employee extends Person{ }
B.public interface Shape { }//语法错了
public class Employee extends Sha pe { }
C.public interface Color{ }//语法错了
public class Employee extends Color{ }
D.public class Species { }
public classAnimal{private Species species;}
E.interface Component { }
Class Container implements Component (
Private Component[] children;
二.whichstatement is true?
A.Ananonymous innerclass may be declared asfinal
B.Ananonymous innerclass can be declared as private
C.Ananonymous innerclass can implement mutiple interfaces
D. An anonymous inner class can access final variables in any enclosing
scope (不能)
E. Construction of an instance of a static inner class requires an instance of
the encloing outerclass
构造一个静态的内部类对象需要构造包含它的外部类的对象
三. Given:
1.package foo;
2.
3.public class Outer (
4. public static class Inner (
5. )
6.)
Whichstatement is true?
A.An instance of the Inner class can be constructed with“new Outer.Inner ()”
B.An instance of the innerclass cannot be constructed outside of packagefoo
他们都是public 的,只要在外部import 就行
C.An instance of the inner class can only be constructed fromwithinthe outer
1
class
D. From within the package bar, an instance of the inner class can be
constructedwith“new inner()”
四.Exhibit (展览、陈列):
1public class enclosinggone{
2 public class insideone{}
3 }
4 public class inertest{
5 public staticvoid main (String[] args){
6 enclosingone eo new enclosingone();
7//insert code here
8 }
}
Whichstatement at line 7 constructs an instance of the innerclass?
A. InsideOne ei eo.new InsideOne(); 写程序试出来
B. Eo.InsideOne ei eo.new InsideOne();
C InsideOne ei EnclosingOne.new InsideOne();
D.EnclosingOne InsideOne ei eo.new InsideOne();
五.
1) interface Foo{
2) int k 0;
3) }
4)
原创力文档

文档评论(0)