Here is my Java class that detects which type of operating system (OS) you
are using now and what is your operating System version.
This code can detect “Windows”, “Mac”, “Unix” and “Solaris”.
This code can detect “Windows”, “Mac”, “Unix” and “Solaris”.
public class OSChecker {
public static void main(String[] args)
{
String
OS = System.getProperty("os.name");
System.out.println("Your OS is :
" +
OS);
String
OSVersion = System.getProperty("sun.arch.data.model");
System.out.println("Your OS
version is : " + OSVersion + " bit");
}
}
No comments:
Post a Comment