可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

What will be written&e


What will be written to the standard output when the following program is run?()   class Base {  int i;  Base() {   add(1);   }   void add(int v) {  i += v;  }   void print() {  System.out.println(i);  }   }   class Extension extends Base {  Extension() {  add(2);  }   void add(int v) {  i += v*2;  }  }   public class Qd073 {   public static void main(String args[]) {  bogo(new Extension());  }   static void bogo(Base b) {  b.add(8);  b.print();   }   }  

  • A9
  • B18
  • C20
  • D21
  • E22
参考答案
参考解析:
分类:SCJP程序员认证考试题库
相关推荐

1、What will be written&e

What will be written to the standard output when the following program is run?()  publi...

2、What will be the 

What will be the result of attempting to compile and run the following code?()  public&...

3、表达式10>5&&6%3的值是()

表达式10>5&&6%3的值是()A-1B非零值C0D1

4、What will be the 

What will be the end result of this set of RMAN commands?()  shutdown abort startup&ens...

5、What will be written&e

What will be written to the standard output when the following program is run?() public&ensp...

6、What would the amps be at 240 volts wi

What would the amps be at 240 volts with an 8 ohm resistance?()A32~5 ampsB25 ampsC1~5 ampsD30 am