📄 beerblast.java
字号:
public class BeerBlast {
static final String COMMAND = "java BeerBlast slave";
public static void main(String[] args) throws Exception {
if (args.length == 1 && args[0].equals("slave")) {
for (int i = 99; i > 0; i--) {
System.out.println(i + " bottles of beer on the wall");
System.out.println(i + " bottles of beer");
System.out.println("You take one down, pass it around,");
System.out.println((i-1) + " bottles of beer on the wall");
System.out.println();
}
} else {
// Master
Process process = Runtime.getRuntime().exec(COMMAND);
int exitValue = process.waitFor();
System.out.println("exit value = " + exitValue);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -