What are the OOPS concepts?
Answer Posted / ram
There are so many things in oops which are related to it.
The first we understand that the full form of oops is
OBJECT ORIENTED PROGRAMING STRUCTURE.Many people knows that
the full form of oop but they don't know about the s means
structure which may be asked in interview.
Now we discuss about the concepts
THEY ARE
1.OBJECTS:
An object is an abstraction of a real world entity. It may
represent a person,a placea number and icons or something
else that can be modelled.Any data in an object occupy some
space in memory and can communicate with eachother .
2.CLASSES:
A class is a collection of objects having common
features .It is a user defined datatypes which has data
members as well functions that manupulate these datas.
3. Encapsulation: It is the mechanism that binds together
code and data in manipulates, and keeps both safe from
outside interference and misuse. In short it isolates a
particular code and data from all other codes and data. A
well-defined interface controls the access to that
particular code and data.
4. Inheritance: It is the process by which one object
acquires the properties of another object. This supports
the hierarchical classification. Without the use of
hierarchies, each object would need to define all its
characteristics explicitly. However, by use of inheritance,
an object need only define those qualities that make it
unique within its class. It can inherit its general
attributes from its parent. A new sub-class inherits all of
the attributes of all of its ancestors.
5. Polymorphism: It is a feature that allows one interface
to be used for general class of actions. The specific
action is determined by the exact nature of the situation.
In general polymorphism means "one interface, multiple
methods", This means that it is possible to design a
generic interface to a group of related activities. This
helps reduce complexity by allowing the same interface to
be used to specify a general class of action. It is the
compiler's job to select the specific action (that is,
method) as it applies to each situation
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
What is difference between inheritance and polymorphism?
What is the significance of classes in oop?
What is abstract class in oop?
What is polymorphism what are the different types of polymorphism?
What is encapsulation with real life example?
What is abstraction in oops with example?
What is class encapsulation?
#include
What are the three main types of variables?
program for insertion ,deletion,sorting in double link list
Why is static class not inherited?
Can abstract class have normal methods?
Why do we use polymorphism?
What is the problem with multiple inheritance?