举一反三
- 顺序执行下面的语句后,输出的结果是。 public class A{ public static void main(String[] args){ int i; int a[]=new int[10]; for(i=0;i<a.length;i++) a[i]=i*10+i; for(i=1;i<a.length;i++) if(a[i]%5==0) System.out.println(a[i]); } }
- 阅读下面的代码,输出结果是( ) public static void main(String[] args) { Random random1 = new Random(10); Random random2 = new Random(10); for(int i=0;i<5;i++){ System.out.print(random1.nextInt(5)); } for(int i=0;i<5;i++){ System.out.print(random2.nextInt(5)); } }
- 下列程序的运行结果是()。 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 ) _
- 以下代码的输出结果是_________。publicstaticvoidmain(String[]args){for(inti=1;i<;=10;i++){if(i%2==0||i%5==0){continue;}System.out.print(i+"\t");}} A: 1 B: 134 C: 13579 D: 1379
- 阅读下面程序中,while循环的循环次数是() public static void main(String[ ] args){ int i = 0; while(i<10){ if(i<1){ continue; } if(i==5) { break; } i++; } }
内容
- 0
阅读下面的代码 public static void main(String[] args) { Random random1 = new Random(10); Random random2 = new Random(10); for(int i=0;i<5;i++){ System.out.print(random1.nextInt(5)); } System.out.println(); for(int i=0;i<5;i++){ System.out.print(random2.nextInt(5)); } } 下列选项中,程序的输出结果是
- 1
阅读下面的代码,输出结果是() public static void main(String[] args) { Random random1 = new Random(10); Random random2 = new Random(10); for(int i=0;i<5;i++){ System.out.print(random1.nextInt(5)); } for(int i=0;i<5;i++){ System.out.print(random2.nextInt(5)); } } A: 3.030130301E9 B: 5.04813268E9 C: 3.268023579E9 D: 1111111111
- 2
以下代码的输出结果是_________。publicstaticvoidmain(String[]args){for(inti=1;i<=10;i++){if(i%2==0||i%5==0){continue;}System.out.print(i+"\t");}} A: 1 B: 134 C: 13579 D: 1379
- 3
以下程序的运行结果为? class Test2{ public static void main(String[] args) { int[] seeds = {1,2,3,5}; int n = seeds.length; for (int i = 0; i < 2; i++) for (int k = 0; k< n-1; k++) seeds[k]= seeds[k+1]; for (int i = 0; i 输出: 3 5 5 5
- 4
下面代码的运行结果是。 public class Test { public static void main(System[] args){ int[ ] a ={10,20,30}; int[ ] b ={1,2,3,4,5}; a=b; for (int i=0;i<a.length;i++){ System.out.print(a[i]+” ”); } } }[/i]