Ultimate C# Masterclass - Pag 9 and 10
Ultimate C# Masterclass - Pag 9 and 10
Custom constructor
● How to define custom constructors in a class
● What the recommended naming for fields is
Methods in classes
● How to define methods in classes
● How methods should be named
● The rule of thumb we can use to find out what the default access modifiers in C# are
Encapsulation
● What encapsulation is
● How is encapsulation different from data hiding
● The benefits of using encapsulation
Methods overloading
● What methods overloading is
● What rules we must follow when defining many methods with the same name in a class
● How to quickly create a constructor using Visual Studio
Expression-bodied methods
● How to make methods shorter by converting them to expression-bodied methods
● The difference between a statement and an expression
"this" keyword (current instance reference)
● How to use the “this” keyword to refer to the current instance of a class
Optional parameters
● How to define optional parameters
● How to set the default value of a parameter
Properties
● What properties are
● What a backing field of a property is
● What accessors are
● What the differences between fields and properties are
● When should we use fields, and when properties
Object initializer
● What object initializers are
● The purpose of the init accessor