如何在java中向一个arraylist添加标记? 我想将标记添加到数组列表中。
StringTokenizer st = new StringTokenizer(line, ":Mode set - Out of Service In Service");
while(st.hasMoreTokens()){
out.println(st.nextToken());
答案 0 :(得分:1)
List<String> list = new ArrayList<String>();
StringTokenizer st = new StringTokenizer(line, ":Mode set - Out of Service In Service");
while(st.hasMoreTokens()){
// out.println(st.nextToken());
list.add(st.nextToken());
}