Section 1 :Declaration and Access
Control
State the legal return types for any method given the
declarations of all related methods in this or parent
classes.
A
method is related to other methods in its own class in
case of overloading and with methods in its parent
classes in case of overriding.
In
case of overloading, the return type does not matter.
So, all the overloaded methods in a class can have
different return types.
But
in case of overriding, the return type of the
overriding method must be same as that of the
overridden method in the parent class.
section1-1 | section1-2 | section1-3 | section1-4
Sections :
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11
|