更多"下列程序的执行结果是( )。
public class Te"的相关试题:
[单项选择]下列程序的执行结果是( )。
public class Testee{
public static void main(String args[ ]){
int a=4,b=6,c=8;
String s="abc";
System.out.println(a+b+s+C) ;
}
}
A. ababcc
B. 464688
C. 46abc8
D. 10abc8
[单项选择]下列程序的执行结果是
public class Testee{
public static void main(String args[ ]){
int a=4,b=6,c=8;
String s="abc";
System.out.println(a+b+s+C) ;
}
}
A. ababcc
B. 464688
C. 46abc8
D. 10abc8
[单项选择]下列程序执行结果是 #include <iostream.h> class A { public: int a; A( ):a(10){cout<<a<<endl;} }; void main( ) { A obj1; A obj2(obj1); cout<<" "<<obj2.a<<endl; }
A. 10 10
B. 编译错误缺少拷贝构造函数
C. 10随机数
D. 随机数随机数
[单项选择]执行下面程序后输出的正确结果是( )。 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
[单项选择]下列是一个Java应用程序,输出结果是 public class Testmm { public static void main(String args[]) { for(char c='a';c〈=‘d’;c++) {if(c==‘c’)break; System.out.print(c); } } }
A. ab
B. abc
C. abd
D. abcd
[单项选择]下列程序执行后,k的值是 ( ) public class Testhhh { publicstaticvoidmain(Stnngargs[]) { int i=6,j=8,k=10,m=7; if(i>j||m<k- -) k+ +; else k--; System.out.println(k);
A. 12
B. 11
C. 10
D. 9
[单项选择]执行下列程序之后,变量n的值为( )。 public class Test { publie static void main (String[] args) { int y=2; int z=3; int n=4; n=n+ -y * z/n; System. out. println (n); } }
A. 3
B. -1
C. -12
D. -3
[单项选择]下列程序执行结果是
#include<iostream.h>
class A
{ public:
int a;
A( ):a(10){tout<<a<<endl;}
};
void main( )
{ A obj1;
A obj2(obj1);
cout<<" "<<obj2.a<<endl;
}
A. 10 10
B. 编译错误缺少拷贝构造函数
C. 10 随机数
D. 随机数随机数
[单项选择]下列程序的执行结果是 public class Testhh { public static void main(String args [] ) { Strings1=new String("I am boy"); Strings2=new String("I am boy"); System.out.println(s1.equals(s2)); } }
A. true
B. false
C. I am boy
D. 都不正确
[单项选择]下列程序的执行结果是 public class Testff{ public static void main(String args[]){ String sl=new String("I am boy"); String s2=new String("I am boy"); System.out.println(sl==s2); } }
A. true
B. false
C. "I am boy"
D. 都不正确
[单项选择]下列程序的执行结果是 public class Testcc { public static void main (String args[ ]) {System.out.println(213.5f%4.0f); } }
A. 1.5
B. 1
C. 1.0
D. 0.5
[单项选择]下列程序的执行结果是 public class Testgg { public static void main(String args[]) { float t=9.0f; int q=5; System.out.println((t++)*(- -q)); } }
A. 40
B. 36
C. 36.0
D. 40.0
[单项选择]下列程序的执行结果是 ( )
public class Testii
public static void main(String args[])
byte y=4;
long r=80L;
System.out.println(r/y);
A. 20B
B. 20
C. 20.0
D. 编译错误
[单项选择]下列程序的执行结果是 ( ) public class Testaa } public static void main(String args[]) {System.out.println(5/2); } }
A. 2.5
B. 2.0
C. 2.50
D. 2