Javaの問題

正解率:69%の問題 前回の解答結果: ログインしてください 解答時間:-

問題

次のプログラムの実行結果として正しいものを
ア~オの選択肢から選びなさい。


public class Test {
public static void main(String args[]) {
HashSet<String> a = new HashSet<>();
LinkedHashSet<String> b = new LinkedHashSet<>();
TreeSet<String> c = new TreeSet<>();

Collections.addAll(a, "b", "b", "a", "a", "c", "c");
Collections.addAll(b, "b", "b", "a", "a", "c", "c");
Collections.addAll(c, "b", "b", "a", "a", "c", "c");

for(String text : a) System.out.print(text+" ");
for(String text : b) System.out.print(text+" ");
for(String text : c) System.out.print(text+" ");
}
}

解答

問題番号:1506031736311作成者:イスンム

コメント