/*
 * This snippet show how to set and get properties.
 *
 * For more information, read "Le guide de survie Java" (chap. 2)
 * (by Timothy Fisher, ed. CampusPress)
 *
 * Usage:
 * - compile: javac Properties.java
 * - execute: java Properties
 */

public class Properties {
    public static void main(String [] args) {

        String timezone;
        
        // Get the timezone property
        timezone = System.getProperty("timezone");
        System.out.println(timezone);

        // Set the timezone property
        System.setProperty("timezone", "EsternStandardTime");
        
        // Get the timezone property
        timezone = System.getProperty("timezone");
        System.out.println(timezone);
    }
}

@@ -1,8 +1,39 @@
+import java.util.Enumeration;%0A%0A
 /*%0A * Th
@@ -357,23 +357,97 @@
     
-String timezone
+// Set the timezone property%0A        System.setProperty(%22timezone%22, %22EsternStandardTime%22)
 ;%0A  
@@ -490,32 +490,39 @@
 roperty%0A        
+String 
 timezone = Syste
@@ -586,16 +586,24 @@
 ezone);%0A
+        
 %0A       
@@ -610,32 +610,23 @@
  // 
-Set the timezone
+Get all
  propert
 y%0A  
@@ -617,33 +617,35 @@
  all propert
-y
+ies
 %0A       
  System.setP
@@ -628,32 +628,66 @@
 ties%0A       
+ java.util.Properties properties =
  System.
 setProperty(
@@ -666,33 +666,33 @@
 erties = System.
-s
+g
 etProperty(%22time
@@ -688,53 +688,88 @@
 pert
-y(%22timezone%22, %22EsternStandardTime%22
+ies();%0A        Enumeration propertyNames = properties.propertyNames(
 );%0A
+%0A
         
 %0A   
@@ -768,134 +768,211 @@
     
-%0A        // Get the timezone property%0A        timezone = System.getProperty(%22timezone%22);%0A        System.out.println(timezone);
+String key;%0A%0A        while(propertyNames.hasMoreElements()) %7B%0A            key = (String) propertyNames.nextElement();%0A            System.out.println(key + %22 = %22 + properties.getProperty(key));%0A        %7D%0A
 %0A   

Update a snippet.