Refresher/m/csharp/Accessibility Modifiers

Database
Gohome.png
Accessibility Modifiers
Ledgray.png
 Class inheritance: colon + base class
Ledgray.png
 Private class-level variables: inherited but not accessible
Ledgray.png
 Value: keyword for implicit input name of the set method in object classes
Ledgray.png
 Protected class-level variables: available to classes in the same namespace
Ledgray.png
 Protected internal: available to derived classes, and classes within the same Assembly, and the base class
Ledgray.png
 Default constructor: disappears when any constructor is written
Ledgray.png
 System.Object: top .NET class that everything is derived from
Ledgray.png
 Method overriding: changing the method behavior for a derived class
Ledgray.png
 Method overloading: using the same method name again in the same class but with different number, type and order of parameters
Ledgray.png
 Virtual method: can be over-ridden but cannot change method signature
Ledgray.png
 Method signature: its name and the number and type of its parameters, where the last parameter may comprise of an array of values
Ledgray.png
 Sealed class (in Java, final class): cannot be inherited
Ledgray.png
 Sealed method: method cannot be inherited but class can when not sealed
Ledgray.png
 Abstract class (in C++, pure virtual method): blueprint for a class without any implementation and thus cannot be instantiated
Ledgray.png
 Abstract class methods: not all must be abstract, some can be concrete
Ledgray.png
 Abstract class required when at least one of the methods in the class is abstract
Ledgray.png
 Abstract method: require non-abstract derived classes to provide their own implementation of this method
Ledgray.png
 Interface class? an abstract class with public abstract methods all of which must be implemented in the inherited classes
Ledgray.png
 Interface class methods: all must be abstract and public and thus accessibility modifiers not needed
Ledgray.png
 Multiple interfaces: can be inherited
Ledgray.png
 Namespace class: classes are declared inside a namespace