从键盘读取数据,当输入end时结束,可是却将结束标记页作为输入的数据存储了,如果才能不存出结束标记呢?
public class TreeSetDemo {
public static void main(String[] args) {
// TODO Auto-generated method stub
BufferedReader bur = new BufferedReader(new InputStreamReader(System.in));
Set<String> li = new TreeSet<String>();
String line = "";
while (!line.equals(null))
{
if(line.equals("end"))
break;
try {
line = bur.readLine();