001 package com.croftsoft.apps.ajgp.data; 002 003 import java.io.IOException; 004 import java.util.Properties; 005 006 /********************************************************************* 007 * Example of storing data using the Properties class. 008 * 009 * @version 010 * 2003-03-25 011 * @since 012 * 2003-03-25 013 * @author 014 * <a href="https://www.croftsoft.com/">David Wallace Croft</a> 015 *********************************************************************/ 016 017 public final class PropertiesExample 018 ////////////////////////////////////////////////////////////////////// 019 ////////////////////////////////////////////////////////////////////// 020 { 021 022 public static void main ( String [ ] args ) 023 throws IOException 024 ////////////////////////////////////////////////////////////////////// 025 { 026 Properties properties = new Properties ( ); 027 028 properties.setProperty ( "health", "10" ); 029 030 properties.setProperty ( "wealth", "99" ); 031 032 properties.setProperty ( "wisdom", "18" ); 033 034 properties.store ( System.out, "Game Data" ); 035 } 036 037 ////////////////////////////////////////////////////////////////////// 038 ////////////////////////////////////////////////////////////////////// 039 }