📄 echo.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 + -