Skip to content

Instantly share code, notes, and snippets.

@yakaviuk
Created March 1, 2020 08:56
Show Gist options
  • Save yakaviuk/0668f5a74fd8d3ee09fa870d19d2c647 to your computer and use it in GitHub Desktop.
Save yakaviuk/0668f5a74fd8d3ee09fa870d19d2c647 to your computer and use it in GitHub Desktop.
Check Java Version
public class Version {
public static void main(String[] args) {
// System.out.println("Enter your name");
// Scanner scan = new Scanner(System.in);
int a, n;
n = args.length;
for (a = n-1; a > -1; a--) {
System.out.println(args[a]);}
String version = Runtime.class.getPackage().getImplementationVersion();
System.out.println(version);
double version1 = Double.parseDouble(System.getProperty("java.specification.version"));
System.out.println(version1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment