⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 systemproperties.java

📁 程序练习中包括书中实例程序代码和练习中要用到的代码,是压缩文件
💻 JAVA
字号:
package examples.collections;
import java.util.*;

/** A class to help demonstrate how to work with
  * system properties
  */
public class SystemProperties {
   /** Display the system properties specified as
     * input parameters or, if no input is given,
     * all the system properties
     * @param args the list of system properties
     *             to be displayed
     */
   public static void main( String[] args ) {
      if ( args.length > 0 ) {
         // dump selected system properties
         for ( int i=0; i<args.length; i++ ) {
            System.out.println( args[i] + ": " +
               System.getProperty( args[i],
                                   "not found" ) );
         }
      } else {
         // dump all system properties
         Properties sysProps = System.getProperties();
         Enumeration e = sysProps.propertyNames();
         while ( e.hasMoreElements() ) {
            String propName = (String)e.nextElement();
            System.out.println( propName + ": " +
               sysProps.getProperty( propName ) );
         }
      }
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -