package com.cjt;
import java.util.ResourceBundle;
public class DBTest {
public static void main(String[] args) {
ResourceBundle bundle = ResourceBundle.getBundle("com/cjt/DB");
System.out.println(bundle);
System.out.println(bundle.getString("cjt"));
System.out.println(bundle.getString("username"));
System.out.println(bundle.getString("password"));
}
}
```xml
username=root;
password=1234;
cjt=cjt
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/1644ae50b0d34ef2a0f93ff58c7268c5.png)