07:31C# params keyword ⚙️
From the creator
C# params keyword tutorial example explained #C# #params #keyword using System; namespace MyFirstProgram { class Program { static void Main(string[] args) { //params keyword = a method parameter that takes a variable number of arguments. // The parameter type must be a single - dimensional array double total = CheckOut(3.99, 5.75, 15, 1.00, 10.25); Console.WriteLine(total); Console.ReadKey(); } static double CheckOut(params double[] prices) { double total = 0; foreach (double price in prices) { total += price; } return total; } } }
Published 2021-07-03 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.





