In C#, Python and/or VB.NET, how can I write a method of a class that can accept different sequences of arguments? As an indication, the multiple choices of arguments sequence would be accessible when pressing shift+shift+space in Visual Studio.
Share
I try to be bit more explicit on method overloading and variable parameter numbers. You can have different methods with the same name in the same
interface,classorstructas long as they have a different number of parameters or parameters of different types (or both) in C# and VB. C# example:In addition, the last parameter can be an array, which represents a varying number of parameters. It must be introduced with the
paramskeyword (C#) or theParamArraykeyword (VB).C#
VB
You can call it like this, C#