A-A+

下列Application程序中 指定as为字符串数组类型 先创建一个HashSet对象并赋

2022-08-06 00:54:32 问答库 阅读 174 次

问题详情

下列Application程序中,指定as为字符串数组类型,先创建一个HashSet对象并赋值,然后在屏幕输出s,请将程序补充完整。
import java.util.*;
public class test17_1{
public static void main(String[] args){
__________s=new HashSet();
s.add("Hello");
s.add("World");
s.add(new Character("我"));
s.add(new Integer(23));
s.add("Hello");
__________as={"W","o","r","1","d"};
s.add(as);
s.add(null);
s.add(new Integer(23));
s.add(null);
System.out.println(__________);请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:Set String[] s
Set String[] s

考点:数组,字符串