Compile-Time and Runtime Polymorphism in Java

A

Arun Kumar

Guest
  • Compile-Time Polymorphism in Java

Compile Time Polymorphism In Java is also known as Static Polymorphism. Furthermore, the call to the method is resolved at compile-time. Compile-Time polymorphism is achieved through Method Overloading.

  • Runtime Polymorphism in Java Method Overriding is done when a child or a subclass has a method with the same name, parameters, and return type as the parent or the superclass; then that function overrides the function in the superclass. In simpler terms, if the subclass provides its definition to a method already present in the superclass; then that function in the base class is said to be overridden.

Reference:


[Operator overloading - to be discussed]

Syntax of early binding

ClassName objectName = new ClassName ();

syntax for late binding

Class name objectName = new DerivedClassName();



Continue reading...
 


Join 𝕋𝕄𝕋 on Telegram
Channel PREVIEW:
Back
Top