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?
[HD Pg 230, Sec. 9.1.1 - inheritance-of-state]
Moderator: admin
-
- Posts: 221
- Joined: Mon Nov 26, 2018 2:43 pm
- Contact:
-
- Site Admin
- Posts: 10404
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: [HD Pg 230, Sec. 9.1.1 - inheritance-of-state]
The emphasis is on extending a class. Interface cannot have any state, and so it cannot extend a class.
-
- Posts: 221
- Joined: Mon Nov 26, 2018 2:43 pm
- Contact:
Re: [HD Pg 230, Sec. 9.1.1 - inheritance-of-state]
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 

Who is online
Users browsing this forum: No registered users and 10 guests