Assume, we have an abstract class A
and we want to force all subclasses to have a certain field. This is not possible in Java, because we can not define abstrac
I prefer the first one . i dont love to couple classes in fileds name , how they handle state and how they save it. the first one is more close to open/close principal
I recommend to avoid inheritance. inheritance is very frigle and hard to maintenance. remember effective java advice - prefer composition other inheritance