checkversion.java
来自「Thinking in Java 是学习JAVA的经典教材」· Java 代码 · 共 18 行
JAVA
18 行
//: com:bruceeckel:tools:CheckVersion.java
// {RunByHand}
// From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
package com.bruceeckel.tools;
public class CheckVersion {
public static void main(String[] args){
String version = System.getProperty("java.version");
char minor = version.charAt(2);
if (minor < '4')
throw new RuntimeException("JDK 1.4.0 or higher " +
"is required to run the examples in this book.");
System.out.println(
"JDK version " + version + " found");
}
} ///:~
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?