网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
以下代码的调试结果为? 1: public class Q10 2: { 3: public static void main(String[] args) 4: { 5: int i = 10; 6: int j = 10; 7: boolean b = false; 8: 9: if(b = i == j) 10: System.out.println("True"); 11: else 12: System.out.println("False"); 13: } 14: }
A.在第9行出现编译错误
B.在第9行出现运行异常
C.输出 :True
D.输出 :False
参考答案和解析
第19行出现编译错误
更多 “以下代码的调试结果为? 1: public class Q10 2: { 3: public static void main(String[] args) 4: { 5: int i = 10; 6: int j = 10; 7: boolean b = false; 8: 9: if(b = i == j) 10: System.out.println("True"); 11: else 12: System.out.println("False"); 13: } 14: }A.在第9行出现编译错误B.在第9行出现运行异常C.输出 :TrueD.输出 :False” 相关考题
考题
执行下列程序段之后,输出的结果为______。public class exl0{public static void main(String[] args){int i=3;int j=7;int k=8;boolean b=j>i∧k!=i;System.out.println(b);}}
考题
下列程序的执行结果为( )。 public class c3 { public static void main(String args[]) { int i=13, j=10; if(i-->j) i++; else j--; System.out.println(i+"\t"+j); } }A.13 10B.12 11C.11 11D.12 12
考题
下面语句执行后,i的值是______。 public class Test11 { public static void main(String[] args) { int i=0; for( int j=10; j>5i<5; j-=3,i+=2 ) { i=i+j; } System.out.println (i); } }A.10B.9C.8D.12
考题
下面程序段的输出结果是( )。 public class Test { public static void main (String[] args) { int j=2,i=5; while (j<i--) j++; System.out.println(j);} }A.2B.3C.4D.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.15B.1C.32D.16
考题
下列程序执行后的结果是______。public class ex24{public static void main(String[] args){int j=10;a1: for(int i=3;i>0;i--){j-=i;int m=l;a2: while (m<j){if (i<=m)continue a1;j/=m++;}}System.out.println(j);}}下列嵌套的循环程序执行后,结果是______。 public class ax25 { public static void main(String[] args) { int sum=0; for(int i=0;i<=5;i++) { for(int j=10;j>3*i;j--) { sum+=j*i; } } System.out.println(sum); } }A.136B.127C.147D.153
考题
下列程序输出结果为( )。public class test { public static void main(String args[]) { int a=0; outer: for(int i=0;i<2;i++) { for(int j=0;j<2;j++) { if(j>i) { continue outer; } a++; } } System.out.println(a); }}A.0B.2C.3D.4
考题
有如下代码段 public class OperatorAndExceptions { public static void main(String args[ ] { int i=10,j=15; System.out.println(i==j); String s1 = new String("how are you!"); String s2=new String("how are you!"); System.out.println(s1==s2); } } 其输出为( )。A.true falseB.true trueC.false trueD.false false
考题
以下程序的输出结果为( )。 public class Main { public static void main(String[] args) { int i=0, j=0, a=6; if((++i>0)||(++j>0)) a++; System.out.println( "i=" +i+", j ="+j+", a="+A; } }A.i=0, j=0, a=6B.i=1, j=1, a=7C.i=1, j=0, a=7D.i=0, j=1, a=7
考题
下列程序的执行结果为( )。 public class c3 { public static void main(String args[]) { int i=13,j=10; if(i--j) i++: elsej--; System.out.println(i+"\t"+j); } }A.13 10B.12 11C.11 11D.12 12
考题
下列程序输出结果为( )。 public class test { public static void main (String args[]) { int a=0; outer:for(int i=0;i<2;i + +) { for(int j=0;j<2;j+ +) { if(j>i) { continue outer; } a+ +; } } System.out.println(a); } }A.0B.2C.3D.4
考题
下面程序的输出结果是( )。 public class Sun { public static void main(String args[]) { int[] a={1,2,3,4); int j=1,s=0; for(int i=3;i>=0;i--) { s=s+a[i]*j; j=j*10; } System.out.println(s); } }A.1234B.21C.43D.4321
考题
下列程序的执行结果为( )。 public class c3 { public static void main (String args[]) { int i=13,j=10; if (i-->j) i++; else j--; System. out.println (i+"\t"+j); } }A.13 10B.12 11C.11 11D.12 12
考题
下列语句执行后,i的值是( )。 public class Test { public static void main(String[ ] args) { int i =0; for(int j=10; j>5i<5; j-=3,i+=2) i=i+j; System.out.println(i); } }A.8B.9C.10D.12
考题
执行下列程序段之后,变量b的值为______。 public class Test9 { public static void main(String[] args) { int i=12; int j=24; boolean b1=true; boolean b=(j%i== 0)(!b1) ||(j/i!=2); System.out.println(b); } }A.trueB.假C.1D.0
考题
以下程序的编译运行结果为:1: public class Q102: {3: public static void main(String[] args)4: {5: int i = 10;6: int j = 10;7: boolean b = false;8:9: if( b = i == j)10: System.out.println("True");11: else12: System.out.println("False");13: }14: }A. 第9行出现编译错误;B. 第9行出现运行错误;C. 输出 TrueD. 输出 False
考题
以下程序的运行结果为class Prob10 {static boolean b1;public static void main(String [] args) {int i1 = 11;double f1=1.3;do {b1 = (f1 >4、} while (!b 1、;System.out.println(b1 + "," + i1 + "," + f 1、;}}A. false,9,4.3B. true,11,1.3C. false,8,1.3D. true,8,7.3
考题
以下程序的运行结果为:public class test {public static void main(String args[]) {int i=0, j=2;do {i=++i;j--;} while(j>0);System.out.println(i);}}
A. 0B. 1C. 2D.3
考题
以下代码的运行结果为:public class Calc {public static void main (String args []) {int total = 0;for (int i = 0, j = 10; total >30; ++i, --j) {System.out.println(" i = " + i + " : j = " + j);total += (i + j);}System.out.println("Total " + total);}}A. 产生运行错误B. 产生编译错误C. 输出 "Total 0"D. 产生如下输出:i = 0 : j = 10i = 1 : j = 9i = 2 : j = 8Total 30
考题
1) class Person { 2) public void printValue(int i, int j) {/*…*/ } 3) public void printValue(int i){/*...*/ } 4) } 5) public class Teacher extends Person { 6) public void printValue() {/*...*/ } 7) public void printValue(int i) {/*...*/} 8) public static void main(String args[]){ 9) Person t = new Teacher(); 10) t.printValue(10); 11) } 12) } Which method will the statement on line 10 call?() A、 on line 2B、 on line 3C、 on line 6D、 on line 7
考题
public class test ( private static int j = 0; private static boolean methodB(int k) ( j += k; return true; ) public static void methodA(int i) { boolean b: b = i 10 | methodB (4); b = i 10 || methodB (8); ) public static void main (String args) } ( methodA (0); system.out.printIn(j); ) ) What is the result?() A、 The program prints “0”B、 The program prints “4”C、 The program prints “8”D、 The program prints “12”E、 The code does not complete.
考题
对于下列代码: 1) class Person { 2} public void printValue(int i, int j) {//... } 3} public void printValue(int i){//... } 4} } 5) public class Teacher extends Person { 6} public void printValue( ) {//... } 7} public void printValue(int i) {//...} 8} public static void main(String args[]){ 9} Person t = new Teacher( ); 10} t.printValue(10); 11} } 第10行语句将调用哪行语句?()A、 line 2B、 line 3C、 line 6D、 line 7
考题
class Ifs{ public static void main(String[] args){ boolean state=false; int i=1; if((++i1)(state=true)) i++; System.out.println(i); } } 结果是() A、5B、编译失败C、运行时异常被抛出D、3E、4
考题
单选题public class test ( private static int j = 0; private static boolean methodB(int k) ( j += k; return true; ) public static void methodA(int i)( boolean b: b = i 10 | methodB (4); b = i 10 || methodB (8); ) public static void main (String args[])( methodA (0); system.out.printIn(j); ) ) What is the result?()A
The program prints “0”B
The program prints “4”C
The program prints “8”D
The program prints “12”E
The code does not complete.
考题
单选题1) class Person { 2) public void printValue(int i, int j) {/*…*/ } 3) public void printValue(int i){/*...*/ } 4) } 5) public class Teacher extends Person { 6) public void printValue() {/*...*/ } 7) public void printValue(int i) {/*...*/} 8) public static void main(String args[]){ 9) Person t = new Teacher(); 10) t.printValue(10); 11) } 12) } Which method will the statement on line 10 call? ()A
on line 2B
on line 3C
on line 6D
on line 7
考题
多选题1) class Person { 2) public void printValue(int i, int j) {/*…*/ } 3) public void printValue(int i){/*...*/ } 4) } 5) public class Teacher extends Person { 6) public void printValue() {/*...*/ } 7) public void printValue(int i) {/*...*/} 8) public static void main(String args[]){ 9) Person t = new Teacher(); 10) t.printValue(10); 11) } 12) } Which method will the statement on line 10 call?()Aon line 2Bon line 3Con line 6Don line 7
考题
单选题对于下列代码: 1) class Person { 2} public void printValue(int i, int j) {//... } 3} public void printValue(int i){//... } 4} } 5) public class Teacher extends Person { 6} public void printValue( ) {//... } 7} public void printValue(int i) {//...} 8} public static void main(String args[]){ 9} Person t = new Teacher( ); 10} t.printValue(10); 11} } 第10行语句将调用哪行语句?()A
line 2B
line 3C
line 6D
line 7
考题
单选题class Ifs{ public static void main(String[] args){ boolean state=false; int i=1; if((++i1)(state=true)) i++; System.out.println(i); } } 结果是()A
5B
编译失败C
运行时异常被抛出D
3E
4
热门标签
最新试卷
![瑞牛题库 章节练习 历年真题 模拟试卷](http://assets.51tk.com/51_sidebar_right_index.jpg)