how-to

Others

How to get operation system name

For this section you need to use:

import java.util.*;

When you need to detect the operation system name use java.lang.System class.

System.out.println( System.getProperty( "os.name" ) );

The output could be:

Windows XP