Possible Duplicate:
What does Map<?, ?> mean in Java?
Java Generics – What is this syntax for?
I was wondering what does the notation < > does in Java, for example.
public static class Map extends MapReduceBase
implements Mapper<LongWritable, Text, Text, IntWritable>
I am not a java expert in any fashion. I hope you can provide some clear answer for the reasons behind using the < > notation.
It denotes generics.
Mapperis a generic and you’re inheriting fromMapper<LongWritable, Text, Text, IntWritable>, which is that generic specialized for those types.It’s like
Vector– also a generic – you can haveVector<Object>andVector<SomeOtherClass>.