2019独角兽企业重金招聘Python工程师标准>>>
/*** */
package com.jason.test;import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;/*** @author jasonLee** @version 2013-10-16*/
public class ParseProperties {/*** @param args*/public static void main(String[] args) {// TODO Auto-generated method stub/** File file =new* File(System.getProperty("user.dir")+"/src/config/date.properties");* FileInputStream inps =null; try { inps =new FileInputStream(file); }* catch (FileNotFoundException e) { // TODO Auto-generated catch block* e.printStackTrace(); }*/InputStream ins=ParseProperties.class.getResourceAsStream("/config/date.properties"); Properties pro = new Properties();try {pro.load(ins);} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}System.out.println("name:" + pro.getProperty("name"));}}