【牛客网】-- 日日刷(第五天)

还剩11天

=========================================================================

1、抽象类方法的访问权限默认都是public。(√)

在Java1.8以前,抽象类方法默认的访问权限为protected
在Java1.8以后,抽象类方法默认的访问权限为default

=========================================================================

2、Which statement at line 11 constructs an instance of the inner class (A D)
  import EnclosingOne.InsideOne
1.class Enclosingone {
2.
3.    public class InsideOne {}
4.
5.}
6.public class inertest {
7.
8.    public static void main(string[]args) {
9.    
10.        EnclosingOne eo = new EnclosingOne();
11.        //insert code here
12.    }
13.
14.}
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();

个人见解:
  A之所以正确是因为在第一行上方有一个导包语句,当导入包之后自然不需要通过外部类名.内部类名的方式,
当然使用外部类名.内部类名的方法也是可以的,因此D选项也是正确的  


鸡汤鸡汤~嗝儿 
1.不是自己的东西不要,就是再喜欢也不行,要懂得放弃;
2.过去的事情可以不忘却,但一定要放下;
3.别人说的记在脑袋里,而自己的则放在心里;
4.你永远没有你本身想象中那么重要;
5.钱能解决的问题统统不叫问题;
6.找点时间,单独呆会儿;
7.不要感到是生活亏欠了你,其实是时机未到或你还努力不够。

评论

暂无评论