本帖最后由 熊亮 于 2013-9-21 22:08 编辑
- package Day19_IO流;
- import java.io.*;
- public class L15_ReadIn {
- public static void main(String[] args)throws IOException
- {
- 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());// 这句代码在myeclipse中报错
- sb.delete(0, sb.length());
- }
- else
- sb.append((char)ch);
- }
- }
- }
复制代码 这是原封不动,老毕视频19-15 读取键盘录入的演示代码
错误提示:Unreachable code
|