An another parameter modifier is params keyword. Like out and ref parameter modifier in C#, we have to use it in method declaration, but we don’t need to use params keyword while passing the method arguments. Params keyword is only used in front of arrays and it should be the last parameter in your method
An another parameter modifier is out, which we use when we are expecting more than 1 output from a method. Normally, a method return only 1 type of value depending upon the return data type like string, int, array etc. In this case, you can create multiple variables of different data types to store the
We have seen how Method Hiding & Method Overriding works. It is time know the main difference between them. This will give you the idea when and where to use them. Method Hiding: In method hiding, if both derived class and base class has a same method name with same signature, then we make use
What is Method Overriding? In method hiding in C#.Net, we have seen how to use new keyword in derived class method to hide the base class method. Also, we know that derived class object will always call to its own method in case of method hiding. But if we create a base class reference variable
As per inheritance in C#, derived class have access to all the code available in base class, which means all the public methods available in the base class are accessible through derived class object. But in some cases, derived class contains a method which is similar by name and signature to the method available in