Overloading / Overriding:
Overloading is about creating multiple methods with the same name, but different signatures, in the same scope.
Overriding is about changing the behavior of a certain method in the child class from the way it is behaving in the parent class.
Abstraction:
Abstraction means to show only the necessary details to the client of the object.
Eg:
1) Do you know the inner details of the Monitor of your PC? What happen when you switch ON Monitor? Does this matter to you what is happening inside the Monitor? No Right, Important thing for you is weather Monitor is ON or NOT.
2) When you change the gear of your vehicle are you really concern about the inner details of your vehicle engine? No but what matter to you is that Gear must get changed that’s it!! This is abstraction; show only the details which matter to the user.
No comments:
Post a Comment