Results 1 to 3 of 3
Thread: Inheritance question
- 04-01-2013, 03:02 AM #1Member
- Join Date
- Feb 2013
- Rep Power
I have a question about inheritance. I read that every class inherits from Object. Say I have a Base class that overrides equals and I have a Derived class that extends Base. So if I called super.equals() from code in the Derived class that calls the equals method of Base correct? Since every class inherits from Object, is the equals method from Object still available to code in the Derived class? How would one call the equals method from Object in Derived.
Also if I override method in Derived, there is not way to call the Base method outside of the Derived class with an instance of Derived correct? In other words a method call is always polymorphic?
- 04-01-2013, 08:27 PM #2
- 04-02-2013, 02:20 AM #3
- By juxta in forum New To JavaReplies: 2Last Post: 12-11-2012, 10:24 PM
- By IAmACodingNoob in forum New To JavaReplies: 3Last Post: 04-06-2012, 12:55 AM
- By Jaevko in forum New To JavaReplies: 7Last Post: 08-31-2011, 07:30 AM
- By hei1233212000 in forum New To JavaReplies: 3Last Post: 11-12-2010, 11:38 AM
- By litojs in forum New To JavaReplies: 8Last Post: 11-10-2008, 10:07 PM