Display Java Specification Version



Use the System.getProperty() method in Java to get the Java Specification Version.

It’s syntax is −

String getProperty(String key)

Above, the key is the name of the system property. Since, we want the Java Specification Version name, therefore we will add the key as −

java.specification.version

The following is an example −

Example

 Live Demo

public class Demo {
   public static void main(String[] args) {
      System.out.print("Java Specification Version: ");
      System.out.println(System.getProperty("java.specification.version"));
   }
}

Output

Java Specification Version: 1.8
Samual Sam
Samual Sam

Learning faster. Every day.


Advertisements