中国大学MOOC:阅读下段代码片段,选择正确的运行结果publicstaticvoidmain(String[]args)inta=1System.out.print(a)inta=2System.out.print(a)inta=3System.out.print(a)_
举一反三
- 下列选项中,循环会无限执行的是______。 A: int i = 1 ; while ( i < 10) System .out .print( “ ” + i) ; B: for( int i = 1 ; i < 10 ;i ++) System .out .print( “ ” + i); C: for( int i = 10 ; i > 0 ;i --) System .out .print( “ ” + i); D: int i = 1 ; while (true) { System .out .print( “ ” + i); i ++ ; if ( i > 5) break ;
- 下列程序的运行结果是()。 public class Test public static void main ( String [ ] args ) int count = 0 for( int i = 1 i < 5 i = 2) for( int j = 1 j< = 10 j = 3) count System .out .print (count ) _
- 中国大学MOOC: 下列代码中构造方法的返回类型是()public class Village { Village () { System .out .println(“hiding in Village”) ; } public static void main( String args [ ]) { Village c =new Village ( ) ;}class Village { public static void main( String args [ ]) { Village c =new Village ( ) ; } Village () { System .out .println(“hiding in Village”) ; } }
- 中国大学MOOC: 阅读下面代码,选择正确的输出结果_______________。grade = 90if grade >= 60: print( D)elif grade >= 70: print( C)elif grade >= 80: print( B)elif grade >= 90: print( A)
- 中国大学MOOC: The content of _______reform carried out by Qin Shi Huang was System of Prefectures and counties(郡县制).