大家好我是陌陌🤭
\textcolor{lightblue}{大家好我是陌陌🤭}
大家好我是陌陌🤭
配置文件
user=赵丽颖
password=abc123
测试代码
public void test2() throws Exception {
Properties pros = new Properties();
FileInputStream fis = new FileInputStream("jdbc.properties");
pros.load(fis);
String user = pros.getProperty("user");
String password = pros.getProperty("password");
System.out.println("user="+user +"\npassword="+password);
}
结果
![image-20221001074251120](https://xingqiu-tuchuang-1256524210.cos.ap-shanghai.myqcloud.com/278/image-20221001074251120.png)
解决方法 \textcolor{green}{解决方法} 解决方法💡
设置——>编译器——>文本编码
将编码方式改为UTF-8,点击确定
![image-20221001074613745](https://xingqiu-tuchuang-1256524210.cos.ap-shanghai.myqcloud.com/278/image-20221001074613745.png)