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
-
OCAJO1
- Posts: 221
- Joined: Mon Nov 26, 2018 2:43 pm
- Contact:
-
admin
- Site Admin
- Posts: 10443
- 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.
-
OCAJO1
- 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: Google Adsense [Bot] and 31 guests