我是靠谱客的博主 风中帅哥,这篇文章主要介绍Thinking in java 从标准输出读取字符串,现在分享给大家,希望可以做个参考。

  1. //: c12:Echo.java
  2. // How to read from standard input.
  3. // {RunByHand}
  4. import java.io.*;
  5. public class Echo {
  6.   public static void main(String[] args)
  7.   throws IOException {
  8.     BufferedReader in = new BufferedReader(
  9.       new InputStreamReader(System.in));
  10.     String s;
  11.     while((s = in.readLine()) != null && s.length() != 0)
  12.       System.out.println(s);
  13.     // An empty line or Ctrl-Z terminates the program
  14.   }
  15. ///:~
  16.  

最后

以上就是风中帅哥最近收集整理的关于Thinking in java 从标准输出读取字符串的全部内容,更多相关Thinking内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(62)

评论列表共有 0 条评论

立即
投稿
返回
顶部