<%@page contentType="text/html;charset=GB2312"%>
<%@page import="java.util.*"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
Insert title here
<%!
TreeSet dictionary = new TreeSet ();
public void addWord(String s){
String word[]=s.split (" ");
for(int i=0;i dictionary.add(word[i]);
}
}
%>
<%
String str=request.getParameter("word");
addWord(str);
Iteratorte=dictionary.iterator();
while(te.hasNext()){
String word=te.next();
out.print(" "+word);
}
%>
就是上面的 new TreeSet ();总是提示错误也不知道是什么原因 代码简单也是照着书上打的 有大牛愿意看看指导一下看看问题出在哪里吗?