1. सीखें
  2. /
  3. पाठ्यक्रम
  4. /
  5. Introduction to Object-Oriented Programming in Java

Connected

अभ्यास

Creating abstract classes

For people who love cars, hearing the horn is all they need to identify a particular type of car. Many car manufacturers know this and make their cars sound unique as a branding strategy. You will update the Car class to contain a method for the horn functionality of cars.

NOTE: An abstract class cannot have instance objects created from it, as it exists to be merely a blueprint from which to be inherited.

निर्देश

100 XP
  • Make the Car class an Abstract class using the abstract keyword.
  • Create a public abstract void method inside Car called soundHorn.