给出下列代码,哪行在编译时可能会有错误? ① public void modify(){ ② int i, j, k; ③ i = 100; ④ while ( i > 0 ){ ⑤ j = i * 2; ⑥ System.out.println (" The value of j is " + j ); ⑦ k = k + 1; ⑧ } ⑨ }
举一反三
- 中国大学MOOC: 给出下列的代码,( )行在编译时可能会有错误。 ① public void modify() {② int i, j, k; ③ i = 100; ④ while ( i > 0){ ⑤ j = i * 2; ⑥ System.out.println ( The value of j is + j ); ⑦ k = k + 1; ⑧ }⑨ }
- 给出下列代码,哪行在编译时可能会有错误?① public void modify(){② int i, j, k;③ i = 100;④ while ( i > 0 ){⑤ j = i * 2;⑥ System.out.println (" The value of j is " + j );⑦ k = k + 1;⑧ }⑨ } A: 4 B: 6 C: 7 D: 8
- 给出下列代码,哪行在编译时可能会有错误?① public void modify(){② int i, j, k; ③ i = 100;④ while ( i > 0 ){ ⑤ j = i * 2; ⑥ System.out.println (" The value of j is " + j ); ⑦ k = k + 1;⑧ }⑨ } A: 4 B: 6 C: 7 D: 8
- 给出下列的代码,( )行在编译时可能会有错误。 ① public void modify() {② int i, j, k; ③ i = 100; ④ while ( i > 0){ ⑤ j = i * 2; ⑥ System.out.println (" The value of j is " + j ); ⑦ k = k + 1; ⑧ }⑨ } A: line 4 B: line 6 C: line 7 D: line 8
- 给出下列的代码,哪行在编译时可能会有错误? ① public void modify() { ② int i,j,k; ③ i=100; ④ while(i>0) { ⑤ j=i*2; ⑥ System.out.println(" The value of j is"+ j); ⑦ k=k+1; ⑧ } ⑨} A.line 4 B.line 6 C.line 7 D.line 8