更多"下列程序执行后,k的值是( )。
public clas"的相关试题:
[单项选择]下列程序执行后,k的值是( )。
public class TestDemo {
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
[单项选择]下列程序执行后,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
[单项选择]下列程序执行后,j的值是 ( ) public class Testggg 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
[单项选择]下列程序执行后,b的值应是 public class Testss { public static void main(String args[]) { unsigned byte b=0; b- -; System.out.println("b="+b); } }
A. -1
B. 255
C. 127
D. 编译错误
[单项选择]下列程序执行后,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
[单项选择]下面程序执行后的输出结果为( )。 public class fun { public static void main(String args[]) { String greets = " How are you!"; String s = greets.substring(0,3); System.out.println(s); } }
A. How
B. are
C. you
D. how are you!
[单项选择]下列程序执行后,m的值是 public class Testbbb { public static void main (String args[ ]) { int a=10,b=3,m=5; if(a= =B) m + =a; else m:+ +a*m; System.out.println(m); } }
A. 15
B. 50
C. 55
D. 5
[单项选择]下列程序执行后,j的值是( )。
public class Testggg {
public static void main(String args[ ])
{
int j=1;
for(int i=7;i>0;i-=2)
j * =2;
System.out.println(j);
}
}
A. 私有派生的子类无法访问父类的成员
B. 类A的私有派生子类的派生类C无法初始化其祖先类A对象的属性,因为类A的成员对类C是不可访问的
C. 私有派生类不能作为基类派生子类
D. 私有派生类的所有子孙类将无法继续继承该类的成员
[单项选择]下列程序执行后,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