Properties of the operating system and Java can be extracted using getProerty() methods of java.lang.System. This method will return an object of type java.util.Properties. Properties object have information in the form of key value pairs. You can extract the information using the keys.

This code will print the name of the Operating System to the console.

 import java.util.Properties;

public class SysPropReader {

    public static void main(String[] args) {

       Properties p=System.getProperties();