Tuesday, 31 May 2011

abstract & interface

If I am designing something which is related with non related classes we go for interface
If we are developing class which is related with hirarecy of classes at that time we go for abstract
example of interface : payment gateways
example of abstract : bird class with aeroplane class

Tuesday, 26 April 2011

Can a method be overloaded based on different return type but same argument type ?

No, because the methods can be called without using their return type in which case there is ambiguity for the compiler.