Results 1 to 3 of 3
Thread: Inheritance question
- 12-11-2012, 09:22 PM #1
Member
- Join Date
- Nov 2011
- Posts
- 30
- Rep Power
- 0
Inheritance question
Hi everyone,
I have a question about inheritance.
Here's my question: Is it possible for a subclass to inherit some or half of the attributes from the superclass? Because my lecture notes say that "A subclass must inherit all the superclass". Sorry if I asked a silly dumb question, I just want to clarify this.
Thanks.
- 12-11-2012, 10:08 PM #2
Senior Member
- Join Date
- Dec 2012
- Posts
- 106
- Rep Power
- 0
Re: Inheritance question
No, when you subclass, you inherit everything, though if things are private in the super-class, they won't be visible in the sub-class.
Maybe you should split your super-class into more than one class.
- 12-11-2012, 10:24 PM #3
Member
- Join Date
- Nov 2011
- Posts
- 30
- Rep Power
- 0
Similar Threads
-
A question on Inheritance and fields
By fatabass in forum New To JavaReplies: 4Last Post: 12-16-2011, 08:39 PM -
inheritance question
By Jaevko in forum New To JavaReplies: 7Last Post: 08-31-2011, 07:30 AM -
Superclass and Inheritance question.
By Dark in forum New To JavaReplies: 6Last Post: 05-06-2011, 07:45 AM -
Question about inheritance
By hei1233212000 in forum New To JavaReplies: 3Last Post: 11-12-2010, 11:38 AM -
a question about inheritance
By litojs in forum New To JavaReplies: 8Last Post: 11-10-2008, 10:07 PM
Bookmarks