📅  最后修改于: 2022-03-11 14:52:18.334000             🧑  作者: Mango
private static List lines = null;
static {
try {
lines = Files.readAllLines(new File("bundles.txt").toPath());
} catch (IOException e) {
e.printStackTrace();
}
}
private Random rand = new Random();
public String getRandomItem() {
return lines.get(rand.nextInt(lines.size()));
}