You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compile-time polymorphism is resolved during the compilation process, before the program runs.
27
25
28
26
This type of polymorphism is typically achieved through method overloading or operator overloading.
@@ -40,7 +38,10 @@ Often used to improve program efficiency by providing method customization witho
40
38
41
39
2. Run-Time Polymorphism (Dynamic Polymorphism)
42
40
43
-
Run-time polymorphism is resolved at runtime, meaning the decision of which method to invoke happens while the program is executing. This is typically achieved through method overriding, where a subclass provides a specific implementation of a method that is already defined in the superclass.
41
+
Run-time polymorphism is resolved at runtime, meaning the decision of which method to invoke happens while the program is executing.
42
+
43
+
This is typically achieved through method overriding, where a subclass provides a specific implementation of a method
44
+
that is already defined in the superclass.
44
45
45
46
Key characteristics:
46
47
Occurs at runtime.
@@ -89,4 +90,4 @@ It is achieved through method overriding and is a key feature of object-oriented
89
90
providing flexibility and extensibility to the code.
90
91
91
92
In summary, polymorphism makes it easier to extend and maintain your code while enabling more flexible and dynamic
0 commit comments