Rabu, 26 April 2017

What are the cases in java where method overriding is possible

What is method overriding? In the context of inheritance, suppose a base class A contains a method display with zero parameters and sub class B also contains a method display with zero parameters, what happens when we create an object for class B and call the display method using that object? The method that will execute is the display method in the sub class B. Then what happened to the display method in super class A? It was hidden. This process of sub class method hiding the super class method when both methods contains same method signature is known as method overriding. When is method overriding possible?

The post What are the cases in java where method overriding is possible appeared first on Coding Security.


What are the cases in java where method overriding is possible
read more

Tidak ada komentar:

Posting Komentar