Javaの問題
問題
次のプログラムの実行結果として正しいものを
ア~オの選択肢から選びなさい。
ア~オの選択肢から選びなさい。
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作成者:イスンム
コメント
この問題を見た人が最近見た問題はこちら
カレントフォルダにある次のプログラムをコンパイルしてできたクラスファイル「TextPrint.class」を実 ...
次のプログラムをコンパイルし、実行するとどうなるか。正しいものを選択してください。
...
次のプログラムをコンパイルし、実行したとします。
class Sample {
...
次はテキストファイル「data.txt」に追加で書き込むための書き込み用文字ストリームを作成する文です。
空 ...
次のプログラムの空欄Aに入れてもエラーとならない(コンパイルに成功する)ものはどれか。正しいものを選んでくださ ...