MatchingLineというクラスがあります
public class MatchingLine implements Comparable
{
private String matchingLine;
private int numberOfMatches;
// constructor...
// getters and setters...
// interface method implementation...
}
私は次のようにArrayListでこのクラスを使用しています-
ArrayList<MatchingLine> matchingLines = new ArrayList<MatchingLine>();
ただし、Netbeans IDEはこのステートメントの横にメモを置き、次のように述べています。
redundant type arguments in new expression (use diamond operator instead)
そしてそれは私が使用することを示唆しています-
ArrayList<MatchingLine> matchingLines = new ArrayList<>();
前者のスタイルは慣習だといつも思っていましたか?後者のスタイルは慣例ですか?