View Single Post
Old 04-15-2013, 02:24 PM   #44
UserNameGoesHere
FFR Veteran
FFR Veteran
 
UserNameGoesHere's Avatar
 
Join Date: May 2008
Posts: 1,114
Send a message via AIM to UserNameGoesHere
Default 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 View Post
Man, what would we do without bored rednecks?
[SIGPIC][/SIGPIC]
UserNameGoesHere is offline   Reply With Quote