Saturday, January 16

Points about OOPS

1. Abstraction is the process of highlighting the essential, inherent aspects of an entity while ignoring irrelevant details.
2. Encapsulation (or information hiding) is the process of separating the external aspects of an objects from the internal implementation details which should be hidden from other objects.
3. Modularity is the process of dividing a problem into smaller pieces so that each smaller module can be dealt with individually.
4. Organizing a set of abstractions from most general to least is known as inheritance hierarchy.
5. Object-oriented programming is a paradigm in which a system is modeled as a set of objects that interact with each other.
6. In C++ an abstraction is formed by creating a class. A class encapsulates the attributes and behaviors of an object.
7. The data members of a class represent the attributes of a class. And the member functions of a class represents the behaviors of a class.
8. Polymorphism is the capability of something to assumediferent forms. In an object-oriented language, polymorphism is provided by allowing a message or member function to mean different things depending on the type of object that receives the message.
9. All C++ program begin executing from the main. Function main returns an integer value that indicates whether the program executed successfullly or not. A value of ) indicates successful execution, while the value 1 indicates that a problem or error occurred during the execution of the program.
10. A variable must be defined before it can be used. Smart programmers give a variable an initial value when it is defined.
11. A pointer is a variable whose value is the address of another variable.
12. Pointers should be different type for each type of variable. There are even pointer types whose variable are pointers to other pointers.
13. The location of a variable can be obtained using the address operator &.
14. Pointer operators may be compared using the equality and relational operators.
15. The increment and decrement operators may be applied to pointer objects.
16. Pointers can be passed as reference parameters by using the indirection operator.
17. Command-line parameters are communicated to programs using pointers.
18. We can define variables that are pointers to functions. Such variables are typically used as function parameters. This type of parameter enables the function that uses it to have greater flexibility in accomplishing its task.
19. A reference variable must be initialized when it is declared.
20. When a reference parameter is used, instead of passing a copy of the variable, a reference to the original variable is passed. Any modifications made to the parameter by the called function change the original variable.
21. A reason to use reference parameter is for efficiency. When a class object is passed by value, a copy of the object is passed. If the object is large, making a copy of it can be expensive in terms of execution time and memory space. thus, objects that are large, or objects whose size is not known are often passed by reference. We can ensure that the objects are not modified by using the const modifier.
22. Constructors initialize objects of the class type. It is standard practice to ensure that every object has all of its data members appropriately initializes.
23. A default constructor is a constructor that requires no parameters.
24. A copy constructor initialize a new object to be a duplicate of a previously defined source object. If a class does not define a copy constructor, the compiler automatically supplies version.
25. A class constructor, if defined, is called whenever a program creates an object of that class.
26. An inline function must be defined before it is called.
27. An inline function reduces the function call overhead. Small functions are best declared inline within a class.

No comments: