Google provides such an example here: http://developer.android.com/training/basics/data-storage/databases.html#DefineContract
public final class FeedReaderContract {
// To prevent someone from accidentally instantiating the contract class,
// give it an empty constructor.
public FeedReaderContract() {}
/* Inner class that defines the table contents */
public static abstract class FeedEntry implements BaseColumns {
public static final String TABLE_NAME = "entry";
public static final String COLUMN_NAME_ENTRY_ID = "entryid";
public static final String COLUMN_NAME_TITLE = "title";
public static final String COLUMN_NAME_SUBTITLE = "subtitle";
...
}
}
Could someone please explain me in detail why is that FeedReaderContract class made final and FeedEntry made abstract? I've seen such approach in many sources and it's clear why FeedEntry's fields are static, but I have no idea why FeedEntry itself is abstract and FeedReaderContract is final. Can we define these classes without these modifiers? What will be the difference? I can't find relevant info anywhere. :(