package bytestream;
import java.io.IOException;
import java.io.InputStream;
public class ReadKeyTest2 {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
readKey2();
}
public static void readKey2() throws IOException {
// TODO Auto-generated method stub
InputStream in=System.in;
StringBuilder sb=new StringBuilder();
int ch=0;
while((ch=in.read())!=-1)
{
if(ch=='r')
continue;
if(ch=='\n')
这里String s 下划线提示错误,不知道为什么
String s=sb.toString
if("over".equals(s {
break;
}
else
{
System.out.println(s.toUpperCase());
sb.delete(0, sb.length());
}
else出现下划线错误
else{
sb.append((char)ch);
}
}
}
}
sb.toString();
没拷全?还是基本语法错误?