有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (3) 个答案

  1. # 1 楼答案

    系统属性^{}提供操作系统的名称

  2. # 2 楼答案

    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

  3. # 3 楼答案

    System.out.println(System.getProperties().get("os.name"));