+ 2
Apa Perbedaan Polimorfisme dan inheritance?
1 Antwort
+ 3
Inheritance is one in which a new class is created that inherits the properties of the already exist class. It supports the concept of code reusability and reduces the length of the code in object-oriented programming.
Types of Inheritance are:
1. Single inheritance
2. Multi-level inheritance
3. Multiple inheritance
4. Hybrid inheritance
5. Hierarchical inheritance.
Polymorphism is that in which we can perform a task in multiple forms or ways. It is applied to the functions or methods. Polymorphism allows the object to decide which form of the function to implement at compile-time as well as run-time.
Types of Polymorphism are:
1. Compile-time polymorphism (Method overloading)
2. Run-time polymorphism (Method Overriding)
For more information:
http://www.geeksforgeeks.org/difference-between-inheritance-and-polymorphism/amp/