Properties:
这是用来读取配置文件
案例如下
public static void main(String[] args) throws IOException { FileInputStream fis = null; try { Properties pros = new Properties(); fis = new FileInputStream("jdbc.properties"); pros.load(fis);//加载流对应的文件 String name = pros.getProperty("name"); String password1 = pros.getProperty("password1"); System.out.println("name"+ name+",password = " + password1); } catch (IOException e) { e.printStackTrace(); } finally { fis.close(); }