Java Specification Version Using System Class
Chapter:
System
Last Updated:
03-08-2016 18:44:34 UTC
Program:
/* ............... START ............... */
public class JavaVersionCheck {
public static void main(String[] args) {
String strJavaVersion = System.getProperty("java.specification.version");
System.out.println("Java Specification is : " + strJavaVersion);
}
}
/* ............... END ............... */
Output
Java Specification is : 1.8
Notes:
-
The java.lang.System.getProperties() method determines the current system properties. The current set of system properties for use by the getProperty(String) method is returned as a Properties object.
Tags
Java specification version, Java, System