/**
*
* Properties集合无法指定泛型,因为该类集合只能存储String类型的数据,该集合通过get和set方法来获取和增加集合的元素
*
*
*/
public class PropertiesTest {
public static void main(String[] args){
Properties properties=new Properties();
properties.setProperty("name","张三");
properties.setProperty("passwords","Admini123456");
System.out.println(properties.getProperty("name"));
System.out.println(properties.getProperty("passwords"));
}
//--------------------------------------------------------------------------------------------------------------------------
}
Properties集合的简单使用
最新推荐文章于 2022-03-30 19:55:27 发布