04-15-2013, 02:24 PM
|
#44
|
FFR Veteran
Join Date: May 2008
Posts: 1,114
|
Re: Teach me CS stuff for interviews
If the Cat class implements a make_sound function, and you call make_sound on a Cat object, you are calling the make_sound from the Cat class unless you first cast the Cat object to be of type Animal (assuming Cat class inherits from Animal class), in which case you'd be calling the make_sound from Animal class.
If the Cat class does not implement a make_sound function, but inherits from an Animal class which does, and you call the make_sound function, you are calling the one from the Animal class.
__________________
Quote:
Originally Posted by Crashfan3
Man, what would we do without bored rednecks?
|
[SIGPIC][/SIGPIC]
|
|
|