adam bien's blog

Compact Attribute Declaration In Java 📎

Attributes in a class don't have to be declared in the verbose way:

public class VerboseClass {
    private String firstName;
    private String lastName;
    private String description;
}


Attributes of the same type and visibility can be declared in a more compact manner:

public class CompactClass {
    private String firstName,lastName,description;
}


This works in most cases - except you want to annotate each attribute in different way....