标签:int void color div stat code package input ade
package com.forname; import java.io.IOException; import java.io.InputStream; import java.util.Properties; public class User { public void ff(){ System.out.println("User.ff()"); } public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException { //反射获取类 Class u=Class.forName("com.forname.User"); User uu=(User) u.newInstance(); uu.ff(); //读取properties文件 InputStream in=User.class.getClassLoader().getResourceAsStream("db.properties"); Properties p=new Properties(); p.load(in); System.out.println(p.get("user")); System.out.println(p.get("name")); System.out.println(p.get("sex")); } }
标签:int void color div stat code package input ade
原文地址:http://www.cnblogs.com/javaweb2/p/6768192.html