public class NullTest
{
public static void main(String[] args)
{
int M = 0;
String str = null;
StringBuffer sb = new StringBuffer(“= “);
sb.append(str);
sb.append(M++);
System.out.println(sb.toString());
}
}
(62)
A.=null
B.=null0
C.=null1
D.=nullM
[单选题]下面是一段javabean程序,该程序的运行结果是(62)。 public class NullTest { public static void main(String[] args) { int M = 0; String str = null; StringBuffer sb = new StringBuffer("= "); sb.append(str); sb.append(M++); System.out.println(sb.toString()); } }A.=nullB.=
[单选题]下面程序段的输出结果是______。 public class Test{ public static void main(String args[ ]){ int x,y; x=(int)Math.sqrt(5/2)+(int)Math.random( )*5/2; y=(int)Math.sqrt(3/2)+(int)Math.random( )*3/2; if(x>y) System.out.println("x>y"); else if(x==y) System.out.printl
[单选题]下列程序的运行结果是 include class A { int a; public: A( ) {a=0;}A(int aa) {下列程序的运行结果是#include<iostream.h>class A{int a;public:A.( ) {a=0;}A.(int aa){a=aa;cout < < a++;}};void main( )A. x,y(2) ,z(3) ;cout < < endl;}A.00B.23C.34D.25
[单选题]分析下面程序,该程序的运行结果是()。includeclass TestClass{public;static int m;分析下面程序,该程序的运行结果是( )。 #include<iostream.h> class TestClass { public; static int m; TestClass () { m++; } TestClass(int n) { m=n; } static void test() { m++; } }; int TestClass::m=0; void ma
[单选题]下面程序执行后,输出的结果是( )。 public class Test { public static void main (String[] )args) { boolean m=true; if(m==false) System.out.println("假"); else if(m====true) System.out.println("真"); else System.out.println ("错误"); } }A.真B.假C.错误D.编译出错
[单选题]执行下列程序段之后,输出的结果是( )。public class Test{ public static void main(String[ ] args) { byte a = 2; short b = 3; long c = 4; c=a%b*4%b; System.out.println(c) ; } }A.2B.1C.-1D.-2
[单选题]下面程序段的运行结果是()。includevoid main(){char str[]="ABC",*p=str;pfintf("%d/n下面程序段的运行结果是( )。 #include<stdio.h> void main() {char str[]="ABC",*p=str; pfintf("%d/n",*(p+3)); }A.67B.0C.字符'C'的地址D.字符'C'
[单选题]下面程序段的运行结果是 include void main( ) {char*s="abcde"; S£«=2;下面程序段的运行结果是 #include<iostream.h> void main( ) { char*s="abcde"; S+=2; cout<<&s;}A.cdeB.字符'c'C.字符'c'的地址D.无确定的输出结果
[单选题]下面程序的运行结果是( )。A. 2.25 3.75B. 1.5 2.25C. 1.5 0.75D. 0.75 1.5
[单选题]下面程序的运行结果是( )。A. 9B. 10C. 11D. 出错