9 Abstraction
9 Abstraction
Programming
Topics To Be Covered Today
Polymorphism
◦ Method Overloading
◦ Method Overriding
◦ Run-time polymorphism
●Upcasting
◦ Polymorphism in multilevel inheritance
◦ Downcasting
Final keyword
Abstraction
◦ Abstract Class
◦ Abstract Method
Abstraction
A process of hiding the implementation details and
showing only functionality to the user.
it shows only important things to the user and
hides the internal details
◦ E.g. sending sms, you just type the text and send the
message. You don't know the internal processing about
the message delivery.
Error??
Output??
class Bike {
abstract void run();
}
Rule:
◦ If there is any abstract method in a class, that class
must be abstract.
Rule:
If you are extending any abstract class that
have abstract method, you must either provide
the implementation of the method or make this
class abstract.
Questions?