单项选择题
下面程序段的输出结果是
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+=*2;
public class Test
public static void main(String args[])
bogo(new Extension());
static void bogo(Base b)
b.add(8);
b.print();
A.9
B.18
C.20
D.22
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
执行下面程序后输出的正确结果是 Public class Test public static void main(String args[]) byte x=3,y=4; long r=80L; System.out.print(r y); System.out.print(”,”); System.out.print(x y);
A.20.0,1
B.20.0,1.0
C.20,0
D.20,1.0
点击查看答案&解析
单项选择题
下面程序段的输出结果为 public class Test int a,b; Test() a=100; b=200; Test(int x,int y) a=x; b=y; public static void main(String args[]) Test Obj1=new Test(12,45); System.out.println(”a=”+Obj 1.a+” b=”+Obj 1.b); Test Obj2=new Test(); System.out.println(”a=”+Obj 2.a+” b=”+Obj 2.b);
A.a=100 b=200
a=12 b=45
B.a=12 b=45
a=100 b=200
C.a=12 b=200
a=100 b=45
D.a=100 b=45
a=12 b=200
点击查看答案&解析
相关试题
下列关于内部类的说法,正确的是
下列关于E-R图的描述中正确的是
在匹配器(Matcher)类中,用于寻找下一个...
下列关系运算中,能使经运算后得到的新关系...
下列叙述中正确的是