Sabtu, 11 Februari 2017

what are the cases where method over riding is possible

Method overriding is possible only when the following things are satisfied: A class inherits from another class (inheritance). Both super class and sub class should contain a method with same signature. Note: Method overriding does not depend up on the return type of the method and the access specifiers like (public, private, protected etc..). What is the difference between method overloading and method overriding? Both may look similar but they are quite different in the following ways: Method overloading takes place when a class contains multiple methods with the same name but varying number of parameters or types of parameters.

The post what are the cases where method over riding is possible appeared first on Coding Security.


what are the cases where method over riding is possible
read more

Tidak ada komentar:

Posting Komentar