package com.itheima;
import java.io.*;
public class ReadInDemo {
/**
* @param args
*/
public static void main(String[] args)throws IOException {
// TODO Auto-generated method stub
InputStream in=System.in;
StringBuilder sb=new StringBuilder();
while(true)
{
int ch=in.read();
if(ch=='\r');
continue;
if(ch=='\n')此句执行不到??????????
{
String s=sb.toString();
if("over".equals(s))
break;
System.out.println(s.toUpperCase());
sb.delete(0, s.length());
}
else
sb.append((char)ch);
}
}
}
报错信息:Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Unreachable code |