更多"下列语句序列执行后,k的值是 ( ) public class "的相关试题:
[单项选择]下列语句序列执行后,k的值是( )。
public class c6
public static void main(String[ ] args)
int a=10, b=18, c=30;
switch (b%
A. 29
B. 27
C. 30
[单项选择]下列语句序列执行后,k的值是( )。
public class Test
public static void main(String[] args)
int m=3, n=6, k=0;
while((m++)<(n--)) ++k;
System. out. println(k);
A. 0
B. 1
C. 2
D. 3
[单项选择]下列语句序列执行后,输出的结果是______。
public class ex37
public static void main(String[] args)
int a=13;
a%=a/5;
System.out.println (a);
A. 1 B. 13 C. 15 D. 55
[单项选择]下列语句序列执行后,j的值是______。
public class ex2
public static void main(String[] args)
int j=2, i=5;
while( j<i--)
j++;
System.out.println(j);
A. 3 B. 2 C. 4 D. 5
[单项选择]下列语句输出结果为( )。
public class test
public static void main(String args[])
byte b=011;
System.out.prinfin(b);
A. B
B. 11
C. 9
D. 011
[单项选择]下面语句执行后,i的值是______。
public class Test11
public static void main(String[] args)
int i=0;
for( int j=10; j>5&&i<5; j-=3,i+=2 )
i=i+j;
System. out.println (i);
A. 10 B. 9 C. 8 D. 12
[单项选择]阅读下列代码
public class Test 2005{
public static void main(String args[]){
Strings="Test";
switch(s){
case "Java":System.out.print("Java");
break;
case "Language":System.out.print("Language");
break;
case "Test":System.out.ptint("Test");
break;
}
}
}
其运行结果是【 】
A. Java
B. Language
C. Test
D. 编译出错
[单项选择]下列程序执行后,k的值是 public class Testddd public static void main(String args[ ]) inti;10,j=18 K=30; switch(j-i) case 8:k++; case 9:k+ =2; case 10:k+ =3; default:k/=j; System.out.println(k);
A. 31
B. 32
C. 2
D. 33
[单项选择]下列程序执行后,k的值是
public class Testhhh
public static void main(String args[ ])
inti=6,j=8,k=10,m=7;
if(i>j| |m k++;
else k- -;
System.out.println(k);
A)12
B)11
C)10
D)9
[单项选择]下列程序执行后,屏幕上显示的应是
public class Testyyy
public static void main(String[]args)
char charl[]=,’t’ ’e’’s],’t’;
char char2[]=’t’,’e’,’s’,’t’,’1’;
String s1=new String(char1);
String s2=new String(char2,0,4);
System.out.println(s1.equals(s2));
A. true
B. false
C. test
D. 编译错误
[单项选择]下列语句输出结果为( )。 public class test public static void main (String args[]) int x=10,y=9; boolean b=true; System.out.println(x<y||!b);
A. true
B. false
C. 1
D. 0
[单项选择]下面的程序执行后,屏幕上显示的应是( )。
public class Exam
public static void main(String[]args)
char char1[]='t','e','s','t';
char char2[]='t','e','s','t','l';
String s1=newString(charl);
String s2=newString(char2,0,4);
System.out.println(s1.equals(s2));
A. true
B. false
C. test
D. 编译错误
[单项选择]下面的程序执行后,屏幕上应显示______。
public class Test
public static void main(String[] args)
char char1[]='t','e','s','t';
char char2[]='t','e','s','t','1';
String s1=new String(char1);
String s2=new String(char2,0 ,4);
System.out.println(s1.equals(s2));
A. true
B. false
C. test
D. 编译错误
[单项选择]下面程序片段的运行结果是( )。
public class Test
public static void main (String args[])
int a=10,b=4,c=20,d=6;
System.out.println (a++ *b+c* --d);
A. 144
B. 160
C. 140
D. 164
[单项选择]下列代码段的执行结果是( )。
public class Test
public static void main(String args[])
String s1=new String("hello");
String s2=new String"hello");
System.out.println(s1==s2);
System.out.println(s1.equal(s2));
A. true false
B. true true
C. false true
D. false false
[单项选择]下列程序运行后的输出结果是( )。
public class Sun
public static void main(String args[])
int a,b;
a=0;
b=0;
for(int m=1;m<=10;m++)
a=a+1;
b=0;
for(int j=1;j<=10;j++)
a=a+1;
b=b+2;
System.out.println(a+","+b);
A. 10,20
B. 20,110
C. 110,20
D. 200,110
[单项选择]运行下面的程序时,会产生( )。
public class Test
public static void main(String args[ ] )
int x =0;
int y = 2/x;
int z[ ] = 1,2,4,6;
int p=z[4];
A. ArrayIndexOutOfBoundsExcePtion异常
B. NumberFormatException异常
C. ArithmeticException异常
D. ArithmeticException异常和ArrayIndexOutOfBoundsExcePtion异常
[单项选择]下列程序执行后,屏幕上显示的应是( )。
public class Testyyy
{public static void main(String[]args)
{ char charl[]={,’’t’’ ’’e’’’’s],’’t’’};
char char2[]={’’t’’,’’e’’,’’s’’,’’t’’,’’1’’};
String s1=new String(char1);
String s2=new String(char2,0,4);
System.out.println(s1.equals(s2));
}
}
A. true
B. false
C. test
D. 编译错误