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];
内容
- 0
下列关于Java数组的代码片段,错误的是( )。 A: int[] a=new int[20]; B: String[] names = new String[3]; C: String[] names = {"Bob", "Achebe", null}; D: int[5] ages = new int[];
- 1
下列哪个选项能正确的创建数组?( ) A: int[,] array = int[4,5]; B: int size = 2;int[] pins = new int [size]; C: string[] str = new string[]; D: int pins[] = new int[2];
- 2
下列哪个选项能正确的创建数组?( ) A: int[,] array=int[4,5]; B: int size=int.Parse(Console.ReadLine()); int[] pins=new int [size]; C: string[] str=new string[]; D: int pins[] = new int[2];
- 3
声明一个有3个元素的String类型的数组,不正确的是 A: String[] str = new String[3]; B: String str[] = new String[3]; C: String [] str = new String[3]; D: String[3] str = new String();
- 4
有如下代码段: String s1=new String(“java”); String s2=new String(“java”);则,s1==s2的结果为____。(填“true” or “false”)