查看网络中的一些 java 示例代码,我遇到了以下语法:
public class WordCount {
public static class Map extends Mapper<LongWritable, Text, Text, IntWritable> {
private final static IntWritable one = new IntWritable(1);
private Text word = new Text();
public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
//...
}
}
//...
}
来自C#背景,静态类不能从另一个类继承,我对类extends
后面的关键字有点困惑Map
。扩展静态类是什么意思,它提供了哪些优势?