oop - How does overloading work? -
let have these overloaded methods in class:
class test{ public void func1(int x , string s) { // } public void func1(int x) { // } public void func1(int x , int y) { // }
what happen (what compiler do) when func1(2,3) class called:
- the compiler finds directly thired version of func1 in class test calling non-overloaded methods or
- like if-else statements, entire overloaded methods name func1 tested find of them has same set of arguments func(2,3)
i searched in documentations couldn't find answer.
Comments
Post a Comment