举一反三
- 下列语句正确的是( ) A: char string[]; string="china"; B: char string1[],string2[]; string2={"china"}; strcpy(string1,string2); C: char string1[5],string2[]={"china"}; string1=string2; D: char string[]="china";
- 下列语句能给数组赋值而不使用for循环的是 A: myArray{[1]="One";[2]="Two";[3]="Three";} B: String s[5]=new String[]{"Zero", "One", "Two", "There", "Four"}; C: String s[]=new String[]{"Zero", "One", "Two", "There", "Four"}; D: String s[]=new String[]=|"Zero", "One", "Two", "There", "Four"};
- 下列【1】【2】【3】【4】注释标注的哪行代码有错误?import java.util.*;public class E {public static void main(String args[]) {Map<;String,String>; map = new HashMap<;String,String>;(); //【1】Set<;Integer>; treeSet = new TreeSet<;Integer>;();//【2】Map<;String,String>; treeMap= new TreeMap<;String,String>;(); //【3】List<;char>; list = new LinkedList<;char>;(); //【4】 A: 【1】 B: 【2】 C: 【3】 D: 【4】
- 以下代码共创建了几个对象?String s1=new String("hello");String s2=new String("hello");String s3=s1;String s4=s2; A: 2 B: 4 C: 1 D: 3
- $string="A";$string=$string x 4;$string.="B";$string.="A";$find_B=index($string,"B");执行以上语句后,$find_B=? A: 4 B: 3 C: 2 D: 1
内容
- 0
声明一个有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();
- 1
Which of the following sentence is right in G major ? A: An open inner string counts as 2, the outer string counts as 5 B: An open inner string counts as 5, the outer string counts as 2 C: An open inner string counts as 2, the outer string counts as 6 D: An open inner string counts as 6, the outer string counts as 3
- 2
下面的哪些程序片断可能导致错误?( ) A: String s=”Hello”; String t=,,World"; String k=s+t; B: String s=,,Hello";String t;t=s[3]+"one"; C: String s="Hello,,;String standard = s.tollpperCase(); D: String s="Hello World”;String t=s-”World”;
- 3
下面的哪些程序片断可能导致错误() A: String s = "Gone with the wind"; String t = " good "; String k = s + t; B: String s = "Gone with the wind"; String t; t = s[3] + "one"; C: String s = "Gone with the wind"; String standard = s.toUpperCase(); D: String s = "home directory"; String t = s - "directory"
- 4
Java中,以下代码会报错会报错的两项是() A: String s = "Gone with the wind"; String t = " good "; String k = s + t; B: String s = "Gone with the wind"; String t; t = s[3] + "one"; C: String s = "Gone with the wind"; String standard = s.toUpperCase(); D: String s = "home directory"; String t = s - "directory";