• 2022-05-27
    16、给出下列的代码,哪行在编译时可能会有错误? ( ) ① public static void main(String args[]){ ② 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
  • C
    本题目来自[网课答案]本页地址:https://www.wkda.cn/ask/ajzomjtotaoymxo.html

    内容

    • 0

      给出下列代码,哪行在编译时可能会有错误?① 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

    • 1

      Given the following code:     1) public void modify() {     2) int i, j, k;     3) i = 100;     4) while ( i > 0 ) {     5) j = i * 2;  6) System.out.println (" The value of j is " + j );     7) k = k + 1;     8) i--;     9) }  10) }  Which line might cause an error during compilation?() A:  line 4 B:  line 6 C:  line 7 D:  line 8

    • 2

      给出下列代码,哪行在编译时可能会有错误?① 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

    • 3

      给出下列代码,哪行在编译时可能会有错误? ①  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; ⑧    } ⑨  }

    • 4

      给出下列的代码,哪行在编译时可能会有错误? ① 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