2012-11-30 103 views

回答

1
public class OpertingSystemInfo 
{ 
    public static void main(String[] args) 
    { 
    String nameOS = "os.name"; 
    String versionOS = "os.version"; 
    String architectureOS = "os.arch"; 

    System.out.println("\n The information about OS"); 
    System.out.println("\nName of the OS: " + System.getProperty(nameOS)); 
    System.out.println("Version of the OS: " + System.getProperty(versionOS)); 
    System.out.println("Architecture of THe OS: " + System.getProperty(architectureOS)); 
    } 
} 

http://www.roseindia.net/java/beginners/OSInformation.shtml

+0

謝謝!一個很好的答案:D – Hoolean

3

系統屬性os.name提供操作系統的名稱。

1
System.out.println(System.getProperties().get("os.name")); 
相關問題