Part 17
Part 17
o If a class extends the abstract class, it must also implement at least one of the abstract
method.
o An abstract class can contain the main method and the final method.
AD
2. {
4.
5. }
7. {
8.
9. @Override
12.
13. }
14.
15. }
16.
18.
20.
21. Honda obj=new Honda();
22. obj.bike();
23. }
24. }
Output:
Bike is running
2. {
4.
5. void car()
6. {
7. System.out.println("Car is running");
8. }
9.
10. }
12. {
13.
14. @Override
17.
18. }
19.
20. }
21.
23.
27. obj.bike();
28. obj.car();
29.
30. }
31.
32. }
Output:
Bike is running
Car is running