Skip to content

Instantly share code, notes, and snippets.

@rayjcwu
Created January 20, 2014 06:51
Show Gist options
  • Save rayjcwu/8516044 to your computer and use it in GitHub Desktop.
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
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