Overriding Tutorial

Rule for overriding: 1) In overriding method signature must be matched in both super and sub class. 2) Co-variant return type: Child class method return type should need not be same as super class method return type. Its child classes are allowed. Example:

This is valid from java 1.5

Co-variant return type rule is […]

OverLoading Tutorial

You might face questions about Overloading  in most of the Java interviews. Overloading is nothing but implementing  ‘n’ of methods with the same name in a Java class, but they must have different method signature. What is method signature in Java ? In java, method signature is as follows.

Note: Return type doesn’t include […]