Object-oriented programming (oop) is a programming paradigm that represents the concept of
“object” that have data fields (attributes that describe the object) and associated procedures known as
An object can be considered a “thing” that can perform a set of related activities. The set of activities
that the object performs defines the object’s behaviour. For example, the hand can grip something or
a student (object) can give the name or address .
Features of opps.
Class and object:- A class is a blueprint that describes characteristics and function of entity.. for example, the class dog would consist of traits shared by all dogs. A class is collection of the properties and methods are called members. Object is an instance of class.
Data abstraction:– it is a process that provides only essential features by hiding its background details. A data abstraction is a simple view of an object that includes required features and hides theunnecessary details.
Data encapsulation:– it is a machine of bundling the data , and the functions that use them and data abstraction is a mechanism of exposing only the interface and hiding the implementation details from the user. C++ supports the properties of encapsulation and the data hiding through the creation of user-defined types, called classes. We already have studied that a class can contain private, protected and public members. By default, all items defined in a class are private.
Inheritance:- it is a process to create a new class from existing class or classes. Class ‘B’ is a sub
class that is derived from class ‘A’. thus class ‘A’ is a parent class and class ‘B’ is a child class. It
provides reusability of code.
Polymorphism:– Generally, it is the ability to appear in different forms. In oops concept, it is the ability to process object differently depending on their data types. It’s the ability to redefine methods for derived classes.
polymorphism is the ability to use an operator or function in different ways. Polymorphism gives different meanings to the operator or functions. Poly, referring to-many, signifies the many use of these operators and functions. A single function usage in many forms or an operator functioning in many ways can be called polymorphism. For example:- #include<iostream.h> […]
software re-usability is primary attribute of software quality. C++ strongly supports the concept of reusability. C++ features such as classes, virtual function, and templates allow designs to be expressed so that re-use is made easier there are many advantage of reusability. They can be applied to reduce cost, effort and time of software development. It […]
C Language 1) Define C-language. Ans: C-language is a structured programming language that divides the program into many functions. 2) When and who developed C-language? Ans: Dennis Ritchie at Bell telephone laboratory-developed C-language in 1972 AD. 3) Why is C called middle level language? Ans: C is called middle-level language because it combines elements of […]