单项选择题
执行下面程序后输出的正确结果是
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
点击查看答案&解析
单项选择题
下面程序段的输出结果是 public class Test public static void main(Stringargs[]) int x,y; x=(int)Math.sqrt(5) 2+(int)Math.random()*5 2; y=(int)Math.sqrt(3) 2+(ht)Math.random()*3 2; if(x>y) System.out.println(”x>y”); else if(x=y) System.out.println(”x=y”); else System.out.Println(”x<y”);
A.x>y
B.x=y
C.x<y
D.编译错误
点击查看答案&解析
相关试题
下面的程序是列出目录C:\Test中所有的.t...
关于文件名的处理中,测试当前文件是否目录...
Java语言的循环语句包括for语句、do-while...
编译Java Applet源程序文件产生的字节码文...
下面程序段是创建一个Date类的对象并把它串...