Display the current user name, current OS version, Java version, Java Home using java code.




package one;

public class Version {
public static void main(String[] a)
{
String s1="user.name";
String s2="os.version";
String s3="java.version";
String s4="java.home";
System.out.println("The current user is " + System.getProperty(s1));
System.out.println("Os version: " + System.getProperty(s2));
System.out.println("Java version: " + System.getProperty(s3));
System.out.println("Java Home: " + System.getProperty(s4));
}
}

Post a Comment

Copyright © Rough Record. Designed by OddThemes