单项选择题
下面程序段的输出结果为
package test;
public class Class A
int x=20;
static int y=6;
public static void main(String args[])
Class B b=new Class B();
b.go(10);
System.out.println("x"+b.x);
class ClassB
int x;
void go(int y)
ClassA a=new ClassA();
x=a.y;
A.x=10
B.x-20
C.x=6
D.编译不通过
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
下面程序段的输出结果为 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=+Obj1.a+ b= +Obj1.B) ; Test Obj2=new Test(); System.out.println( = +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
点击查看答案&解析
单项选择题
执行下面程序后输出的正确结果是 public class Test public stoic 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
点击查看答案&解析
相关试题
在Java Applet程序中,如果对发生的事件做...
铰运算符的功能划分,运算符“+=”的类型是
下列选项默认的布局管理器不是BorderLayout...
通常我们使用哪个方法来为一个部件注册事件...
用来实现Java虚拟机的语言是