面试题答案
一键面试import java.util.StringTokenizer;
public class StringTokenizerExample {
public static void main(String[] args) {
String str = "apple#banana&cherry@date";
StringTokenizer st = new StringTokenizer(str, "#&@");
while (st.hasMoreTokens()) {
System.out.println(st.nextToken());
}
}
}