Class and object: a class is a definition which describes all attributes of entity or an object. And object is an instance of a class.
Inheritance: is a concept of passing and using attributes of base class into derived class.
Polymorphism: single name – multiple use, it can be achieved via Function overloading & operator overloading.
Overloading: is the concept of using function or class with same name but different implementation by changing types of parameters
Static or shared: a keyword to define static class, members of static class doesn't require creating instance of that class.
Virtual: indicated that this base class method is to be overridden. [Without specifying virtual keyword also method can be override, but it makes code more understandable]
Sealed: indicates that this base class method not to be override.
Overriding: is a concept of implementing a method in derived class with same definition of the base class method
Shadowing: without overriding a method derived class can do new implementation where parameters, return type & access modifier may differ from the base class implementation, Shadow is the keyword in C#
Constructor: is a method with same name as class, it gives a way to initiate the class members to default values at the time of object creation, automatically calls whenever class object is created
Static constructor: a type of constructor, calls at the first time object creation.
Serialization: is the process of converting object into a stream of bytes. De-serialization is the reverse process.
Delegate: holds a reference to a function. Type safe pointer
Multicast delegate: holds reference to multiple functions, its return type must be void.
Interface and Abstract:
Abstract class | Interface |
Is a class to provide common fields/members to subclasses | Is a collection of member definitions to be implemented in derived class |
a class can inherit only 1 abstract class | A class can implement many interface |
Members of abstract class can have any access modifier | All members are only public by default, it can’t be changed |
Abstract class method may or may not have implementation | Interface can have only definition of methods, no implementation |
1 comment:
So can we say that OOP's is also an design pattern to achieve more modular, relational and realistic way to solve the problem.
Post a Comment