Search This Blog

Wednesday 12 August 2015

What is the output: int Add(int A, int b); float Add(int A, int b);

int Add(int A, int b);
float Add(int A, int b);

Answer:

ERROR:-
Type ‘Demo.Program’ already defines a member called 'Add' with the same parameter types Program

Explanation:
Throw error because as per Polymorphism rule, method overloading cannot differentiate with its method return type.

No comments:

Post a Comment