using System; namespace MyFirstProgram { class Program { static void Main(string[] args) { // method overloading = methods share same name, but different parameters // name + parameters = signature // methods must have a unique signature double total; total = Multiply(2, 3, 4); Console.WriteLine(total); Console.ReadKey(); } static double Multiply(double a, double b) { return a * b; } static double Multiply(double a, double b, double c) { return a * b * c; } } }
@Wanna_Be_Desu3 жыл бұрын
It's reeeeeally nice to have quick, to the point and, most importantly, standalone video. I can just go to your channel page, type in a keyword and it'll give me the appropriate vid. Very handy, saved me a ton of time! Thanks a lot, Bro!
@Sayori251 Жыл бұрын
isn't this seems like writen with writeline
@zachteel150211 ай бұрын
Cleanest C# tutorials I've found! ❤
@RM-xl1ed2 ай бұрын
short and sweet. nice video
@MagicCubeWorld2 ай бұрын
One bite size topic, straight to the point, crystal clear with a simple, real example. How could anybody complain about that.
@jktenny2 жыл бұрын
Thank you for the short, to the point, and very clear explanation
@vasve20713 жыл бұрын
Simple and clean! Thank you.
@Hari-pw3de Жыл бұрын
Thanks for the quick lesson....
@spartanranger3 жыл бұрын
LETS GO BROOO!
@harishgunasekera10 ай бұрын
Very fast yet efficient. Got the idea quickly in just one minute. This is insane! 😂😂😂
@caseyspaulding2 жыл бұрын
Fast and to the point is so awesome
@elliotradley43702 жыл бұрын
Man said Comment, and I comment, keep up the excellent work bro
@hdheiz6 ай бұрын
LETTSSS GOOO BROOOOOOOOOOOS
@DTHowell2 жыл бұрын
This is the best explanation I’ve ever seen. Idk it confused me before
@saadanwar79142 жыл бұрын
smashed the like button
@ezio95956 ай бұрын
Is the order of parameters in the method is part of the signature of the method too?
@Samuel-lm1wb Жыл бұрын
excellent
@definitelynotchris47764 ай бұрын
Lets go brooo
@Jordan-qi2dn7 ай бұрын
Having issues with this on latest version of C#, "Local function is defined but never used" when I try to use a method overloading with a method with more arguments EDIT: For anyone having issues with this on the newest C# version. You’ll need to use the same syntax as he does here where you have a main() function and define the two functions below it for the method overload to work. By old statements I mean the top level statements that you can’t see in the latest C# version. You can copy and paste the old top level statements into a template file and use it whenever you need to define a bunch of functions or use function overloading. When you make a new file there should be a link on the first line taking you to the documentation on the Microsoft page.
@weirdmovies1113 Жыл бұрын
Thank you so much bro!
@babida91132 жыл бұрын
Legend
@mertkurt9472 жыл бұрын
you are doing it bro
@francescomangano19962 жыл бұрын
Perfect !
@sehmusakbas Жыл бұрын
hell yeah bro
@ahmedhassan5783 Жыл бұрын
done
@budderrar57512 жыл бұрын
noice
@tastefulbob69543 жыл бұрын
why has this only got 50 views o_o
@xarvilla8551 Жыл бұрын
Now it has 10K lol
@whitedinamo3 жыл бұрын
lesson check😇
@CJagent47 Жыл бұрын
What if we want to enter n number of inputs?
@aravindpoddutoori1085Ай бұрын
Why cannot we create only one method where all parameters are defined. I mean can't we just modify method one into, static double multiply ( a,b,c)
@siddharthjain662918 күн бұрын
using System; namespace methodoverloading { class Program { static void Main(string[] args) { double x, y, z; Console.Write("Please enter the number 1 = "); x = Convert.ToDouble(Console.ReadLine()); Console.Write("Please enter the number 2 = "); y = Convert.ToDouble(Console.ReadLine()); Console.Write("Do you want to enter the 3 Number. Please provide input in [Y/N] ? "); String confirmation = Convert.ToString(Console.ReadLine()); confirmation = confirmation.ToUpper(); if (confirmation == "Y") { Console.Write("Please Enter the Number 3 = "); z = Convert.ToDouble(Console.ReadLine()); double result = multiplication(x, y, z); Console.WriteLine("The multiplication of the digits is = " + result); } else { double result = multiplication(x, y); Console.WriteLine("The multiplication of the digits is = " + result); } } static double multiplication(double num1, double num2) { return num1 * num2; } static double multiplication(double num1, double num2, double num3) { return num1 * num2 * num3; } } } i modified it a little bit. I am enjoying learning the coding lenguage. The world of computer is really bveautiful
@simik48303 ай бұрын
commenting!
@notyou3000 Жыл бұрын
asd
@olivervargha-el6bk Жыл бұрын
This isn't working for me... Does it exist that i ruined something? (Visual studio 2022)