import java.util.Vector;ランタイム:
public class Clear_vector {
public static void main(String[] args) {
ベクトル<文字列>vct = new Vector<文字列><文字列>();
//要素を追加
vct.add("un");
vct.add("2");
vct.add("three");
vct.add("4");
System.out.println("削除前:");
for(String e:vct)
System.out.println(e);
System.out.println("\n削除後:");
vct.clear();
for(String e:vct)
System.out.println(e);
}
}
削除前:
one
two
three
four
削除後:
Please disable your ad blocker and refresh the window to use this website.