网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

【分录题】(4-1)写出下面程序运行结果。 public class Demo5 { public static void main(String []args) { int[] arr={12,35,8,7,2}; Arrays.sort(arr); System.out.println(arr[3]*arr.length); } }


参考答案和解析
100(10) < = > 64(16)
更多 “【分录题】(4-1)写出下面程序运行结果。 public class Demo5 { public static void main(String []args) { int[] arr={12,35,8,7,2}; Arrays.sort(arr); System.out.println(arr[3]*arr.length); } }” 相关考题
考题 下面程序的输出结果是()publicclassTest{publicstaticvoidmain(String[]args){Strings=abcdsfghi”;String[]arr=s.split(\s”);System.out.println(arr.length);}} A.编译报错B.2C.1D.3

考题 下列程序的运行结果是【 】。public class Test {public static void main (String args[]) {String s1="hello!";System.out.println (s1.toUpperCase());}}

考题 阅读下面的程序: public class Person{ int arr[ ]=Hew int[10]; public static void main(String args[ ]){ System.out.println(arr[1]); } } 正确的说法是______。A.编译时将产生错误B.编译时正确,运行时将产生错误C.输出为0D.输出为空

考题 阅读下列代码后 public class Person{ int arr[]=new int[10]; public static void main(String args[]){ System.out.println(arr[1]); } } 正确的说法是( )。A.编译时将产生错误B.编译时正确,运行时将产生错误C.输出零D.输出空

考题 本题的功能是计算二维数组各个元素的和。程序中定义了二维数组arr,arr有3行4列共l2个元素,程序中采用for循环语句的嵌套来计算数组中各个元素的和,并将结果保存在sum变量中,最后打印输出结果。 public class javal{ public static void main(String[] args){ int arr[][]={{l,2,3,4},{5,6,7,8},{9,10,11,12}}; int sum=0; int i=0,j=0; for(i=0; ) for( ) ; System.OUt.println("sum="+sum); } }

考题 阅读下列代码Public class Person{Static int arr[ ] = new int (10);Public static void main (String args ) {System.out.println(arr[9]);}}该代码运行的结果是A )编译时将产生错误B )编译时正确,运行时将产生错误C )输出 0D )输出空

考题 下面程序的输出结果是什么? class C1{ static int j=0; public void method(int a){ j++; } } class Test extends C1{ public int method(){ return j++; } public void result(){ method(j); System.out.println(j+method()); } public static void main(String args[]){ new TeA.0B.1C.2D.3

考题 阅读下面代码 public class Person { static int arr[]=new int[10]; public static void main(String args) { System.out.println(arr[9]); } } 该代码的运行结果是A.编译时将产生错误B.编译时正确,运行时将产生错误C.输出零D.输出空

考题 给出下列的程序,其叙述正确的是public class Man { static int arr[]= new int [10]; public static void main (String a []){ System.out.println(arr[1]); }}A.编译时将发生错误B.编译时正确但是运行时出错C.输出为0D.输出为null

考题 阅读下面程序 public class Test3 { public static void main(String[] args) { int x=3,y=4,z=5; String s="xyz": System.out.println(s+x+y+z); } } 程序运行的结果是A.xyz12B.xyz345C.xyzxyzD.12xyz

考题 下列程序的输出结果是class Test{public static void main(String args[]){int n=7;n 下列程序的输出结果是 class Test{ public static void main(String args[]){ int n=7; n<<=3; n=nn+1|n+2^n+3; n>>=2; System.out.println(n); } }A.0B.-1C.14D.64

考题 阅读下列代码: public class Person{ static int arr[]=new int[10]; public static void main(String args){ System.out.println{arr[9]); } } 该代码的运行结果是( )。A.编译时将产生错误B.编译时正确,运行时将产生错误C.输出零D.输出空

考题 给出下列的程序,其叙述正确的是 ( ) public class Man { static int arr[]=new int[10]; public static void mam(String a[]) { System.out.println(arr[1]); { }A.编译时将发生错误B.编译时正确但是运行时出错C.输出为0D.输出为null

考题 阅读下列代码后 public class Person{ int art[]=new int[10]; public static void main(String args[]){ System.out.println(arr[1]); } } 正确的说法是( )。A.编译时将产生错误B.编译时正确,运行时将产生错误C.输出零D.输出空

考题 2给出下列的程序,其叙述正确的是( )。public class Man{static int arr[]=new int[10];public static void main(String args[]){System.out.println (arr[1=];}}A.编译时将发生错误B.编译时正确但是运行时出错C.输出为0D.输出为null

考题 本题中数组arr中存储了学生的成绩,分别为87,45,56,78,67,56,91,62,82,63,程序的功能是计算低于平均分的人数,并打印输出结果。请在程序空缺部分填写适当内容。使程序能正确运行。public class javal{public static void main(String[]args){int arr[]={56,91,78,67,56,87,45,62,82,63};int num=arr.lengthint i=0;int sumScore= 0;int sumNum=0;double average;while(i&lt;num){sumScore=sumScore+arr[i];;}average= ;i=0;do{if(arr[i]&lt;average)sumNum++:i++;}while( );System.OUt.println("average:"+average+",be-lows average:"+sumNum);}}

考题 本题的功能是计算二维数组arr[][]={{34,21,45,67,20},{23,10,3,45,76},{22,3,79,56,50}}中的最小值,并输出。public class javal{public static void main(String[]args){int arr[][]={{34,21,45,67,20),{23,10,3,45,76},{22,3,79,56,50}};int i=0:intj=0;int min=arr[0][0];while(i&lt;3){while( ){if(arr[i][j]&lt;min)min=arr[i][j];j++;};;}System.out.println("The min:"+min);}}

考题 本题将数组中arr[]={5,6,3,7,9,1}的各个元素按下标的逆序输出。public class javal{public static void main(String[]args){int arr[]={5,6,3,7,9,1};;n= ;while(n&gt;=O){System.OUt.print(arr[n]+"");;}}}

考题 给出下面的程序: public class ex49 { static int arr[] = new int[10]; public static void main(String args [] ) { System.out.println (art [1] ); } } ______叙述是正确的。A.编译时将发生错误B.输出为 nullC.输出为0D.编译时正确但是运行时出错

考题 给出下面代码:public class Person{static int arr[] = new int[10];public static void main(String a[]) {System.out.println(arr[1]);}}以下那个说法正确? A. 编译时将产生错误;B. 编译时正确,运行时将产生错误;C. 输出0;D. 输出null。

考题 下面程序的输出结果是() public class Test{  public static void main(String[] args){    String s = “abc dsf ghi”;  String[] arr = s.split(“/s”);   System.out.println(arr.length);  } }A、 编译报错B、 2C、 1D、 3

考题 What will be the result of attempting to run the following program?()   public class Qaa75 {   public static void main(String args[]) {   String[][][] arr = {   { {}, null },   { { "1", "2" }, { "1", null, "3" } },   {},   { { "1", null } }  };   System.out.println(arr.length + arr[1][2].length);   }   }  A、The program will terminate with an ArrayIndexOutOfBoundsException.B、The program will terminate with a NullPointerException.C、4 will be written to standard output.D、6 will be written to standard output.E、7 will be written to standard output.

考题 Given the following code:     public class Person{     int arr[] = new int[10];  public static void main(String a[]) {     System.out.println(arr[1]);     }     }  Which statement is correct?() A、 When compilation some error will occur.B、 It is correct when compilation but will cause error when running.C、 The output is zero.D、 The output is null.

考题 Given the following code:     public class Person{ static int arr[] = new int[10];  public static void main(String a[]) {     System.out.println(arr[1];)     }     }  Which statement is correct?()   A、 When compilation some error will occur.B、 It is correct when compilation but will cause error when running.C、 The output is zero.D、 The output is null.

考题 单选题Given the following code:     public class Person{ static int arr[] = new int[10];  public static void main(String a[]) {     System.out.println(arr[1];)     }     }  Which statement is correct?()A  When compilation some error will occur.B  It is correct when compilation but will cause error when running.C  The output is zero.D  The output is null.

考题 单选题What will be the result of attempting to run the following program?()   public class Qaa75 {   public static void main(String args[]) {   String[][][] arr = {   { {}, null },   { { "1", "2" }, { "1", null, "3" } },   {},   { { "1", null } }  };   System.out.println(arr.length + arr[1][2].length);   }   }A The program will terminate with an ArrayIndexOutOfBoundsException.B The program will terminate with a NullPointerException.C 4 will be written to standard output.D 6 will be written to standard output.E 7 will be written to standard output.

考题 单选题Given the following code:     public class Person{     int arr[] = new int[10];  public static void main(String a[]) {     System.out.println(arr[1]);     }     }  Which statement is correct?()A  When compilation some error will occur.B  It is correct when compilation but will cause error when running.C  The output is zero.D  The output is null.

考题 单选题下面程序的输出结果是() public class Test{  public static void main(String[] args){    String s = “abc dsf ghi”;  String[] arr = s.split(“/s”);   System.out.println(arr.length);  } }A  编译报错B  2C  1D  3