Results 1 to 4 of 4
- 10-03-2012, 03:14 PM #1
Member
- Join Date
- Oct 2012
- Posts
- 2
- Rep Power
- 0
Simple subclass, superclass question
I'm new to Java but after reading the tutorial docs on their website I can't quite see why this is false (its a question from my learning materials).
When a subclass extends a superclass, all methods that are contained in the superclass are accessible from the subclass.
What Is Inheritance? (The Java™ Tutorials > Learning the Java Language > Object-Oriented Programming Concepts)
"This gives MountainBike all the same fields and methods as Bicycle..."
So why is this false?
Please can someone explain this to me?
-
Re: Simple subclass, superclass question
Methods can have different "access" modifiers such as public, protected, and.....

You get my hint?
- 10-03-2012, 03:32 PM #3
Member
- Join Date
- Oct 2012
- Posts
- 2
- Rep Power
- 0
Re: Simple subclass, superclass question
aaah private :)
thanks
-
Similar Threads
-
Superclass and Subclass Constructor Question
By achiu17 in forum New To JavaReplies: 1Last Post: 01-30-2012, 05:05 AM -
Array of Objects (Superclass containing Subclass)
By stupidwaldo in forum New To JavaReplies: 47Last Post: 12-12-2011, 01:29 PM -
subclass calling superclass method
By stackptr89 in forum New To JavaReplies: 10Last Post: 11-22-2010, 07:40 PM -
superclass and subclass
By mr idiot in forum New To JavaReplies: 19Last Post: 01-03-2009, 07:29 AM -
which class is superclass and subclass?
By java_fun2007 in forum New To JavaReplies: 0Last Post: 12-11-2007, 08:55 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks