当前位置: 技术问答>java相关
麻烦解析一下这两道题的意思,谢谢
来源: 互联网 发布时间:2015-05-07
本文导语: 81. which prevent create a subclass of outer class? A.static class FooBar{} B.pivate class Foobar{} **C.abstract class FooBar{} ## D.final public class FooBar{} E.final abstract class FooBar{} 93. AnInterface is an in...
81. which prevent create a subclass of outer class?
A.static class FooBar{}
B.pivate class Foobar{}
**C.abstract class FooBar{}
## D.final public class FooBar{}
E.final abstract class FooBar{}
93. AnInterface is an interface
AnAdapter0 is a non-abstract,non-final class with a zero
argument constructer
AnAdapter1 is a non-abstract,non-final class without a zero
argument constructer,but with a constructer that takes one int argument
which two creat an anoymous inner class?
##A.AnAdapter0 aa=new AnAdapter0(){}
##** B.AnAdapter1 aa=new AnAdapter1(5){}
C.AnAdapter1 aa=new AnAdapter1(){}
D.AnAdapter0 aa=new AnAdapter0(5){}
E.AnInterface ai=new AnInterface(5){}
A.static class FooBar{}
B.pivate class Foobar{}
**C.abstract class FooBar{}
## D.final public class FooBar{}
E.final abstract class FooBar{}
93. AnInterface is an interface
AnAdapter0 is a non-abstract,non-final class with a zero
argument constructer
AnAdapter1 is a non-abstract,non-final class without a zero
argument constructer,but with a constructer that takes one int argument
which two creat an anoymous inner class?
##A.AnAdapter0 aa=new AnAdapter0(){}
##** B.AnAdapter1 aa=new AnAdapter1(5){}
C.AnAdapter1 aa=new AnAdapter1(){}
D.AnAdapter0 aa=new AnAdapter0(5){}
E.AnInterface ai=new AnInterface(5){}
|
我想正确答案应该是标了##的选项吧,不知你表**是不是代表有疑问。
81 final用于类定义表示该类是不可继承的,abstract表示该类是必须被继承的,这样很明白了吧(注意:final与abstract不可以同时使用)
82 因为AnAdapter1没有zroe argument constructor所以在实现匿名内部类时需要加入参数用于对付类构造函数的调用
81 final用于类定义表示该类是不可继承的,abstract表示该类是必须被继承的,这样很明白了吧(注意:final与abstract不可以同时使用)
82 因为AnAdapter1没有zroe argument constructor所以在实现匿名内部类时需要加入参数用于对付类构造函数的调用
|
1:D
2:AB
1:Final类不能有子类,final变量是常量,final函数不能重载。
2:如polarislee(北极星)所说。
2:AB
1:Final类不能有子类,final变量是常量,final函数不能重载。
2:如polarislee(北极星)所说。