单项选择题
下面程序段的输出结果为
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
点击查看答案&解析
相关试题
下面的程序是列出目录c: Test中所有的.t...
关于文件名的处理中,测试当前文件是否目录...
编译Java Applet源程序文件产生的字节码文...
Java语言的循环语句包括for语句、do-while...
下面程序段是创建一个Date类的对象并把它串...