001package edu.pdx.cs410J.core; 002 003import java.util.*; 004 005/** 006 * This class demonstrates the <code>Properties</code> class and shows 007 * how to use the JVM's system properties. 008 */ 009public class SystemProperties { 010 011 /** 012 * Print out a couple of the system properties and check to see if 013 * the "edu.pdx.cs410J.Debug" property has been set on the command 014 * line. 015 */ 016 public static void main(String[] args) { 017 // Print out some properties 018 Properties props = System.getProperties(); 019 props.list(System.out); 020 021 // Is the "edu.pdx.cs410J.Debug" property set? 022 String name = "edu.pdx.cs410J.Debug"; 023 boolean debug = Boolean.getBoolean(name); 024 System.out.print("\nAre we debugging? "); 025 System.out.println((debug ? "Yes." : "No.")); 026 } 027 028}