aijava

welcome to my online log ! open java new world! Taste java charm........
posts - 1, comments - 4, trackbacks - 0, articles - 42
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

java基础学习10(java.util.properties)

Posted on 2006-11-12 23:03 阅读(112) 评论(0)  编辑  收藏 所属分类: java基础学习系列
import  java.util.Properties;

public class  MainClass  {
     public static  void  main ( String args []) {
         Properties prop =  new  Properties () ;
         prop.put ( "a" "1" ) ;
         prop.put ( "b" "2" ) ;
         prop.put ( "c" "3" ) ;
         Properties book =  new  Properties ( prop ) ;
         book.put ( "A" "4" ) ;
         book.put ( "B" "5" ) ;
        
         System.out.println ( "a "  + book.getProperty ( "a" )) ;
         System.out.println ( "A "  + book.getProperty ( "b" )) ;
         System.out.println ( "c: "  + book.getProperty ( "c" )) ;

         System.out.println ( "z: "  + book.getProperty ( "z" "default" )) ;
     }
}
http://freehost13.websamba.com