每日一练:计算机二级考试Java每日一练(2018/6/13)
【单选题】下面程序段的输出结果为( )。
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 Objl=new Test(12,45);
System.OUt.println("a="+Objl.a+"b="+Objl.
b);
Test Obj2=new Test();
System.out.println("fl="+Obj2.a+"b="+Obj2.
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
在下面提交答题后即可查看答案与试题解析
发布评论 查看全部评论