更多"下列程序的执行结果是 public class Testii "的相关试题:
[单项选择]下列程序的执行结果是 ( )
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 Testrr public static void main(String args[]) int i=0xFFFFFFF1; int j=-i; System.out.println("j="+j);
A. j=-15
B. j=-16
C. j=16
D. j=15
[单项选择]下列程序的执行结果是 ( )
public class ex68
public static void main(String[]args)
ex68 obj=new ex68( );
int s=0;
for(int i=1;i<=4;i++)
s+=obj.method(i);
System.out.println(s);
public int method(int n)
if(n==1)
return 1;
else
return n*method(n-1);
A. 3
B. 9
C. 33
D. 153
[单项选择]下列程序的执行结果是 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
[单项选择]下列程序的执行结果是
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 Test
public static void main(String args[])
System.out.print(100%3);
System.out.print(",");
System.out.print(100%3.0);
A. 1,1
B. 1,1.0
C. 1.0,1
D. 1.0,1.0
[单项选择]下面程序段的输出结果为( )。
mblic class Test
public static void main(String args[])
boolean a,b,c;
a=(3<5);
b=(a==true);
System.out.println("a="+a+"b="+b);
c=(b=false);
System.out.println("b="+b+"c="+c);
A. a=true b=false
B. a=true b=false
C. a=true b=true
D. a=false b=false
[填空题]以下程序运行后的输出结果是 【15】 。
int a=5;
fun (int b)
static int a=10;
a+=b++;
printf("%d ",a);
main( )
int c=20;
fun(c);
a+=c++;
Printf("%d/n",a);
[单项选择]下列程序执行后,i的值是 public class Testfff pubic static void main(String args[]) int i;10; do i/=2; while(i- - >1); System.out.println(i);
[单项选择]下面是一个Java的应用程序,其输出结果是
public class Testll
public static void main (String args[])
char c='i';
for(int n;6;n<11;m + +)
if(n = =8)continue;
System.out.print(c + +);
A. ij
B. ijkc)ijklD)ijklm
[单项选择]下列程序执行的输出结果是( )。
#inClude<stdio.h>
main( )
char a[2][4];
strcpy(a,"are");strcpy(a[1],"you");
a[0][3]='&';
printf("%s/n",
A. ;
B. you
C. are
D. &
[单项选择]下列程序执行输出的结果是( )。
#include<stdio.h>
f(int
[单项选择]下列程序执行后的输出结果是 void funcl(int i); void func2(int i); char st[]="hello,frlend!"; void funcl(int i) { cout<<st[i]; if(i<3){i+=2;func2(i);} } void func2(int i) { cout<<st[i]; if(i<3){i+=2;funcl(i);} } main( ) { int i=0; furicl(i); cout<<endl;}
A. hello
B. hel
C. hlo
D. hlm
[填空题]请阅读下列程序代码,然后将程序的执行结果补充完整。
程序代码:
public class throwsExcepfion
static void Proc(int se1)
throws ArithmeticException,ArraylndexOutOfBoundsException
System.out.println("in Situation"+se1);
if(se1==0)
System.out.println("no Exception caught");
return;
else if(se1==1)
int iArray[]=new int[4];
iArray [1]=3;
public static void main(String args[])[
try
Proc(0);
Proc(1);
catch(ArraylndexOutOfBoundsException e)
System.out.println("Catch"+e);
finally
System.out.println("in Proc finally");
执行结果:
In Situation( )
no ExcepbOn cauSht
______
in Proc findly
[单项选择]下列程序执行后的输出结果是( )。
#include<stdio.h>
void func(int *a,int b[])
b[0]=*a+6;
main( )
int a,b[5];
a=0;b[0]=3;
func(&a,b);
printf("%d/n",b[0]);
A. 6
B. 7
C. 8
D. 9
[单项选择]下述程序执行的输出结果是( )。
#include<stdio.h>
main( )
char a[2][4];
strcpy(a,"are");strcpy(a[1], "you");
a[0][3]='&';
printf("%s/n",a);
A. are&you
B. you
C. are
D. &
[单项选择]下列程序执行后输出的结果是( )。
int d=1;
fun (int p)
{ int d=5;
d + =p + +;
printf("%d,",d); }
main( )
{ int a=3;
fun(a);
d + = a + +;
printf("%d/n",d); }
A. 8, 4
B. 9, 6
C. 9, 4
D. 8, 5
[单项选择]下列程序执行后,j的值是( )。
public class Test
public static void main(String args[])
int j=1;
for(int i=7; i>0; i-=2)
j*=2;
System.out.println(j);
A. 15
B. 1
C. 32
D. 16