在 java 语言中, 下列语句中正确的是哪个? ( )
A: String temp[]=new String{"a" "b" "c"};
B: String temp[]={"a" , "b" , "c"};
C: String temp={"a" "b" "c"};
D: String temp[]={"a","b","c"};
A: String temp[]=new String{"a" "b" "c"};
B: String temp[]={"a" , "b" , "c"};
C: String temp={"a" "b" "c"};
D: String temp[]={"a","b","c"};
举一反三
- 在Java语言中,下列语句中正确的是()。 A: String temp[] = new String{"j""a""z"}; B: String temp[] = {"j""a""z"}; C: String temp = {"j""a""z"}; D: String temp[] = new String[]{"j","a","z"};
- String str = “oop.163.com”; String temp[ ] = str.split("."); 执行完该语句,temp的内容为:temp[0]=oop temp[1]=163 temp[2]=com A: 正确 B: 错误
- 下面的语句哪个能够创建一个String类对象 A: String str1="mooc"; B: String str2=new String(); C: String str3=new String("sdut"); D: String str4="abc"+"123";
- 中国大学MOOC: String str = “oop.163.com”; String temp[ ] = str.split(.); 执行完该语句,temp的内容为:temp[0]=oop temp[1]=163 temp[2]=com
- 创建到数据库连接的语句正确的是 A: Class.forName() B: DriverManager.getConnection(String url,String username,String pwd) C: new SQLException() D: new Connection(String url,String username,String pwd)