Java 倒入文章显示前n个单词频率
package com_1; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Scanner; class Word //定义出一个单词类 { String value; //具体的单词 int geshu; //出现的个数 Word next; //将单词链起来 public Word(String value,int geshu) //带参构造函数 { this.value=value; this.geshu=geshu; next=null; } public Word() //空构造函数 { this.value=""; this.geshu=0; next=null; } } public class Shuru { public static void main(String args[]) throws IOException //主函数 { Scanner dc = new Scanner(System.in); Word word=new Word(); //单词的链头 Word lian,xin; String str=""; FileReader f=new FileReader("F:\