Page 1 of 1

[HD Pg 230, Sec. 9.1.1 - inheritance-of-state]

Posted: Tue Feb 26, 2019 2:43 pm
by OCAJO1
I'm probably jumping the gun here, but I wanted to ask,

Looking at "Only a class can contain state and therefore, only a class can extend another class." statement; I wonder since an interface can extend another interface, does it mean an interface can contain a state too?

Re: [HD Pg 230, Sec. 9.1.1 - inheritance-of-state]

Posted: Tue Feb 26, 2019 3:47 pm
by admin
The emphasis is on extending a class. Interface cannot have any state, and so it cannot extend a class.

Re: [HD Pg 230, Sec. 9.1.1 - inheritance-of-state]

Posted: Tue Feb 26, 2019 7:28 pm
by OCAJO1
Boy did I make a jumble. The only ingredient missing is the abstract class - well at least that one would have had a chance through its subclass ;)