I have a class called MatchingLine
public class MatchingLine implements Comparable
{
private String matchingLine;
private int numberOfMatches;
// constructor...
// getters and setters...
// interface method implementation...
}
I am using this class in an ArrayList as follows -
ArrayList<MatchingLine> matchingLines = new ArrayList<MatchingLine>();
However, the Netbeans IDE puts a note beside this statement and says,
redundant type arguments in new expression (use diamond operator instead)
and it suggests that I use -
ArrayList<MatchingLine> matchingLines = new ArrayList<>();
I always thought the former style was the convention? Is the latter style the convention?