#Hierarchy Priority

6 messages · Page 1 of 1 (latest)

slow aspen
#

•If a class and its superclass have methods with same signatures, the class's method takes priority over the superclass's.

My teacher wrote this and he said it was because of convenience... but I'm not sure why it would prioritize the class over superclass? What if the class method had specific parameters that superclass didn't have? wouldn't the program want to run something with the superclass then?

ripe idolBOT
#

This post has been reserved for your question.

Hey @slow aspen! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

native jay
#

What if the class method had specific parameters that superclass didn't have?
then that wouldn't be the same signature

red quartz
native jay
#

the name is part of the signature