以下哪些创建数组的方式是正确的?
A: int[] ary = new int[5];
B: boolean[] ary = {true,true,false};
C: String[] ary = new String[3]{"你","们","好"};
D: String[] ary = new String[]{"你","们","好"};
A: int[] ary = new int[5];
B: boolean[] ary = {true,true,false};
C: String[] ary = new String[3]{"你","们","好"};
D: String[] ary = new String[]{"你","们","好"};
举一反三
- 在下面的二维数组定义正确的是______ A: int ary[5][ ]; B: int ary[ ][5]={{0,1,2}}; C: int ary[ ][5]; D: int ary[5,5];
- 下面定义数组语句,正确的是( ) A: int arr = new arr[10][2]; B: int ary = {1,2,3,4,5}; C: int[] ary = new arr[10]; D: int[] arr = {-1,"2",3,4,5};
- 6、下列程序的运行结果是()。String s1 = new String( "abc" );String s2 = new String( "abc" );System.out.println( s1 == s2);String s3 = "你好吗?" ;String s4 = "你" ;String s5 = "好吗?" ;System.out.println( "你好吗?" ==("你" + "好吗?")); A: true true B: false false C: false true D: true false
- String str1 = new String("ABC");String str2 = new String("ABC");str1 == str2 的值是True还是False呢?
- 下列数组定义正确的是( )。 A: int[] a[]= new float[2]; B: byte b[][]=new byte[3][]; C: String[] str=new String[3]; D: int my[][]=new int[3][3];