Page 1 of 1

About Question enthuware.ocpjp.v7.2.1229 :

Posted: Thu Jan 22, 2015 8:21 pm
by ewebxml
Question:
For option c, why can't the root class for a hierarchy of related classes be a concrete
parent class?

I understand that in practice you normally make a parent class of
2 concrete subclasses abstract,
as in

Code: Select all

abstract class Employee{}
with concrete subclasses

Code: Select all

HourlyEmployee extends Employee{}
SalariedEmployee extends Employee{}

Re: About Question enthuware.ocpjp.v7.2.1229 :

Posted: Thu Jan 22, 2015 9:32 pm
by admin
You certainly can.
But the question is asking for a valid reason for creating an abstract class and it is certainly a valid reason for an abstract class as well.