I have an abstract class Entity
and then multiple instance can extend Entity
like
A extends Entity {
}
B extends Entity {
}
Now all the entity needs to have entityId
So should I have entityId
as a private field in Entity
and set it via the constructor, or as a protected
member in Entity
, so that the subclasses can access it directly?