摘要:You can overload a method in a class, i.e. define two methods with the same name, if the methods have different lists of parameters. The parameter lists must differ in the number of parameters or in their types.For example, we can overload the Dog.Bark method if the parameters differ only in type:1
阅读全文
摘要:Here's a summary of the different parameter modifiers and how the behavior changes for each, when using them with value-typed and reference-typed variables.No modifier - value typesCopy of value passed to methodMethod can read valueNo modifier - reference typesReference to object passed to metho
阅读全文
摘要:As an object-oriented language, c# supports the three core principles of object-oriented programming:Encapsulation - Hide implementation details in a class from users of the class, exposing only a public interfaceInheritance - Derive a subclass from a parent class, inheriting data and behavior from
阅读全文