我有一个 .txt 文档,其中包含一个单词列表,每行一个单词。有十行。我如何阅读这份文档,从中随机选择一行,然后显示该单词?
这是我到目前为止的代码:
    Scanner fileScan, wordScan;
    String word;
    Random rand = new Random();
    int pickedLine = rand.nextInt(6)+1;
    fileScan = new Scanner(new File("list.txt"));
    while (fileScan.hasNext()) {
        word = fileScan.nextLine();
        System.out.println()
    }