INTEG FINALS
Inheritance
Definition: Inheritance is one of the principles of object-oriented programming that allows the defining of a child class that reuses or inherits the behavior of a parent class (or existing class).
Derived class or subclass
Definition: The inheriting class is called a derived class or subclass.
Base class or superclass
Definition: The existing class whose members are being inherited is called base class or superclass.
Single inheritance
Definition: The C# programming language only supports single inheritance, where a subclass can only inherit from a single superclass.
Transitive inheritance
Definition: Because inheritance is transitive, the members of the class Person is available to the upcoming derived classes of the Student or Teacher classes.
Namespace
Definition: The Person and Student classes are both members of the namespace PersonNamespace.
Private members
Definition: A derived class can inherit the private members of a base class, but these are not accessible.
Protected members
Definition: Unlike private, the protected members of a base class are inherited and are accessible by their derived classes.
Protected keyword
Definition: The keyword protected is used to declare a protected member.
Calling base class constructors
Definition: When a derived class inherits from a base class, it does not inherit the constructors of the base class to prevent problems in initializing fields of an object, but derived classes can invoke the constructors of the base class which can help in initializing the fields of an instance of the class.
Base keyword
Definition: In C#, the base keyword is used to specify which constructor from the base class should invoke when creating instances of the derived class.
Method overriding
Definition: A derived class inherits the methods of its base class.
Overriding method
Definition: Declaring a method in a derived class with the same name as the method from its base class is called method overriding.
Virtual modifier
Definition: The virtual modifier specifies that a derived class can override the method in the base class.
Override modifier
Definition: When overriding a virtual method from the base class, the override modifier is required to modify the abstract or virtual implementation of the inherited method and must have the same method signature as the overridden method (virtual method).
Abstract class
Definition: An abstract class is a base class that cannot be instantiated to create an object.
Abstract keyword
Definition: The abstract keyword is used to declare an abstract class and is placed before the class name.
Abstract method
Definition: An abstract method is a method header with an abstract modifier that has no implementation or method body, for its implementation is provided by overriding it on derived class.
Polymorphism
Definition: Polymorphism, which means “multiple forms,” is one of the fundamental concepts of object-oriented programming.
Compile time polymorphism (static polymorphism)
Definition: Compile time polymorphism – Also known as “static polymorphism,” this polymorphism is implemented using method overloading.
Method overloading
Definition: In method overloading, a method is executed depending on the number and type of parameters passed to it.
Early binding
Definition: When a program is compiled, the compiler binds the appropriate method to the object based on the method’s arguments.
Runtime polymorphism (dynamic polymorphism)
Definition: Runtime polymorphism – This polymorphism is a process in which the compiler determines which method to call during runtime.
Late binding
Definition: This process is also called dynamic polymorphism or late binding.
Method overriding (as runtime polymorphism)
Definition: This is achieved using method overriding.
Interface
Definition: An interface only contains the signatures of methods, properties, and events as its members.
Implementing class
Definition: It is the responsibility of the class implementing the interface to provide the implementation of the members.
Instantiation of interface
Definition: Interfaces cannot be instantiated, and its members cannot contain any code that implement its members; only the signatures can.
Interface keyword
Definition: In C#, interfaces are defined using the interface keyword.
Interface naming convention
Definition: A common naming convention is to begin all interface names with a capital I.
Interface member access
Definition: The modifiers of the members of an interface are all public by default.
Colon symbol (:) for implementing
Definition: An interface can be implemented on a class using the colon (:) symbol.
Matching method signature
Definition: The method implementation in the class must have the same signature, parameters, and method name as defined in the interface.
Interface implementation rule
Definition: Interfaces ensure that the implementing classes implement all the methods and properties declared in the interface.
Multiple interface implementation
Definition: A class can inherit only one (1) base class, but a class can implement multiple interfaces.
Syntax for multiple interfaces
Definition: To implement multiple interfaces, the colon (:) symbol is used then the interfaces are declared in a comma-separated list.
Interface field restriction
Definition: An interface cannot contain instance variables or fields but may contain properties.
Interface property
Definition: A property can access a private data member of the class.
Property declaration syntax in interface
Definition: A read (get) and write (set) property can be declared in an interface using this syntax: datatype propertyName { get; set; }
Purpose of accessors in interface
Definition: The purpose of the accessors is to indicate the properties are read-write.
Interface
Definition: An interface only contains the signatures of methods, properties, and events as its members.
Implementing class
Definition: It is the responsibility of the class implementing the interface to provide the implementation of the members.
Instantiation of interface
Definition: Interfaces cannot be instantiated, and its members cannot contain any code that implement its members; only the signatures can.
Interface keyword
Definition: In C#, interfaces are defined using the interface keyword.
Interface naming convention
Definition: A common naming convention is to begin all interface names with a capital I.
Interface member access
Definition: The modifiers of the members of an interface are all public by default.
Colon symbol (:) for implementing
Definition: An interface can be implemented on a class using the colon (:) symbol.
Matching method signature
Definition: The method implementation in the class must have the same signature, parameters, and method name as defined in the interface.
Interface implementation rule
Definition: Interfaces ensure that the implementing classes implement all the methods and properties declared in the interface.
Multiple interface implementation
Definition: A class can inherit only one (1) base class, but a class can implement multiple interfaces.
Syntax for multiple interfaces
Definition: To implement multiple interfaces, the colon (:) symbol is used then the interfaces are declared in a comma-separated list.
Interface field restriction
Definition: An interface cannot contain instance variables or fields but may contain properties.
Interface property
Definition: A property can access a private data member of the class.
Property declaration syntax in interface
Definition: A read (get) and write (set) property can be declared in an interface using this syntax: datatype propertyName { get; set; }
Purpose of accessors in interface
Definition: The purpose of the accessors is to indicate the properties are read-write.