Created
January 20, 2014 06:51
-
-
Save rayjcwu/8516044 to your computer and use it in GitHub Desktop.
With reference to the wheelCount() method, the three classes shown above demonstrate which aspect of object-oriented programming?
1. AOP - (Aspect Oriented Programming)
2. Method overload
3. Multiple inheritance
4. Polymorphism
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Vehicle { | |
abstract int wheelCount(); | |
} | |
class Automobile extends Vehicle { | |
int wheelCount() { | |
return 4; | |
} | |
} | |
class Motorcyle extends Vehicle { | |
int wheelCount() { | |
return 2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment