Java入門–Vectorの簡単な使い方
Javaコード:
package com.jz345.javademo;
import java.util.Vector;
public class VectorDemo {
/**
* @param args
*/
public static void main(String[] args) {
@SuppressWarnings({ “rawtypes", “unchecked" })
Vector<String> v = new Vector(4);
v.add(“***Excerise00***");
v.add(“***Excerise01***");
v.add(“***Excerise02***");
v.add(“***Excerise03***");
v.add(“***Excerise04***");
v.remove(“Sampe00");
v.remove(0);
int size = v.size();
System.out.println(“size:" + size);
for(int i = 0;i < v.size();i++){
System.out.println(v.get(i));
}
}
}
実行結果
size:4
***Excerise01***
***Excerise02***
***Excerise03***
***Excerise04***