C# method overloading,Overriding wala different return types use karanna puluwanda? dekedima baane, ethakota monawahari change karala use karanna puluwan neda?
common interview question
overloading
You can not overload the function by differ only their return type . You can only overload the function in following ways
You can not come to know which function is actually called (if it was possible).
- Parameter types
- Number of parameters
- Order of the parameters declared in the method
public int Bar(int a)
{
return 10;
}
public string Bar(int a)
{
return "10";
}
error : already defines a member called 'Bar' with the same parameter types
EMINƎM;24136484 said:Java walath overloading krnna ba return type wenas krla. Ambiguity eka nisa.
Eth Java 5 wala idala override krna method eke return type wenas krnna puluwan. Ekata kiyanne covariant return type kylaa
Kinda too simple in my opinion. Interesting question though.
Kinda too simple in my opinion. Interesting question though.
Like I said, it's an interesting question to measure logical thinking. We use similar questions.man. this can be expanded to almost a 1-hour interview.
Like I said, it's an interesting question to measure logical thinking. We use similar questions.
A friend of mine got this in one of his interviews afaik. It's just not hard.
Cool. Didn't knew that.this is not to evaluate how good you are with algo. it is to see how you envision maintainability, scalability into your solution. how open are you for refactoring etc. some tech companies ask a very simple question and build a big interview on that. I was asked to compare two string to see if they are anagrams. from this, I designed complete rest service with multi-data-center solution to few thousands of requests per second.