black

SCJP程序员认证考试

登录

多项选择题

Which statements can be inserted at the indicated position in the following code to make the program write 1 on the standard output when run?() 
public class Q4a39 { 
int a = 1;  
int b = 1;  
int c = 1;  
class Inner {  
int a = 2;  int get() {  
int c = 3;  
// insert statement here  return c; 
 }  
}  Q4a39() {  
Inner i = new Inner();  
System.out.println(i.get());  }  
public static void main(String args[]) { 
 new Q4a39(); 
 }  
}  

A.c = b;
B.c = this.a;
C.c = this.b;
D.c = Q4a39.this.a;
E.c = c;

相关考题

单项选择题 HowdoestheweightypropertyoftheGridBagConstraintsobjectsusedingridbaglayoutaffectthelayoutofthecomponents?()

多项选择题 Which lines of code are valid declarations of a native method when occurring within the declaration of the following class?()    public class Qf575 {   // insert declaration of a native method here   }

单项选择题 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();   }   }

All Rights Reserved 版权所有©在线考试题库网(zxkao.com)

备案号:湘ICP备14005140号-7

经营许可证号:湘B2-20140064