java get OS version
You can check your current system's operating system version by the java code also. For this purpose you have to use the System's property "os.version". Its very simple to know your operating system's version in java. This program displays how one can use the System.getProperty() method to get Operating System Version.
In this example java program we have fetched the operating system's version by using the System.getProperty("os.version").
String osVersion= System.getProperty("os.version");
Above line of code gets the operating system's version and stores version in a string osVersion. Here is the full source code of GetOSVersion.java as follows:
Output of our program :
Operating system version =>5.0
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: October 24, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles