⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 echo.java

📁 Java程序设计技巧与开发实例附书源代码。
💻 JAVA
字号:

import java.io.*;

public class Echo
{
   public static void main(String args[])
   {
      PrintStream out = null;
      if (args.length == 1)
      {
         String fileName = args[0];
         try
         {
            out = new PrintStream(new FileOutputStream(fileName));
            System.out.println("Output redirected to " + fileName);
            System.setOut(out);
         }
         catch (IOException ioe)
         {
            System.err.println(ioe);
         }
      }
      else
      {
         System.out.println("Output not redirected to a file");
      }
      System.err.println("Enter the single word 'quit' to quit");
      String s = new String();
      while (!s.equals("quit"))
      {
         s = Console.readString();
         System.out.println(s);
      }
      if (out != null)
      {
         out.close();
      }
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -