package com.atguigu.java;
import java.io.FileInputStream;
import java.util.Properties;
/**
* @author Dxkstart
* @create 2021-05-23 18:59
*/
public class PropertiesTest {
//Properties:常用来处理配置文件。key和value都是String类型
public static void main(String[] args) throws Exception {
Properties prop = new Properties();
FileInputStream fil = new FileInputStream("jdbc.properties");
prop.load(fil);//加载流对应文件
String name = prop.getProperty("name");
String password = prop.getProperty("password");
System.out.println(name + password);
}
}
name=Tom
password=abc123