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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
OCAJO1
Posts: 221
Joined: Mon Nov 26, 2018 2:43 pm
Contact:

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

Post 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?

admin
Site Admin
Posts: 10404
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

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]

Post 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 ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests