0
Why is the output 9 not 6 ?
What is the output of this code? static void Print(int a) { Console.WriteLine(a*a); } static void Print(double a) { Console.WriteLine(a+a); } static void Main(string[] args) { Print(3); }
3 Antworten
+ 1
Yep because 3 is an integer
This is a case of overloading.
https://www.sololearn.com/learn/Java/2165/?ref=app
0
Is it because Print(3) is an integer ?
0
Thanks a bunch!