多选题

What’s the output of&n...

发布于 2022-03-03 17:31:15

What’s the output of following code?(单选)

class A {
  public void one() { System.out.println("one") }
  private void two() { System.out.println("two") }
  static void three() { System.out.println("three") }
  protected void four() { System.out.println("four") }
  public void test() {
    this.one()
    this.two()
    this.three()
    this.four()
  }
}

class B extends A {
  public void one() { System.out.println("Bone") }
  private void two() { System.out.println("Btwo") }
  static void three() { System.out.println("Bthree") }
  protected void four() { System.out.println("Bfour") } 
}

public class Test {
  public static void main (String[] args) {
    B b = new B()
    b.test()
    b.three()
  }
}

登录后免费查看答案
关注者
0
被浏览
38
知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看