[求助]为何退出不了循环
本人刚学java,写了一个小程序,不知为何终止不了循环,请大家帮忙看看import java.io.*;
class MyIO
{
public static void main(String[] args)
{
String s="";
String ss=new String();
boolean bool = true;
do
{
System.out.print("请输入内容:");
BufferedReader cin = new BufferedReader(new InputStreamReader(System.in));
try
{
s = cin.readLine();
}
catch (IOException e)
{
return;
}
System.out.println("你输入的是:"+s);
System.out.print("是否继续?<y/n>:");
try
{
ss = cin.readLine();
}
catch (IOException e)
{
}
if(ss=="y")
{
continue;
}
else
if(ss=="n")
{
bool = false;
}
}
while (bool);
}
}