• Home
  • Subscribe
  • Contribute Us
    • Share Your Interview Experience
  • Contact Us
  • About Us
    • About CSEStack:
    • Campus Ambassador
  • Forum & Discus
  • Tools for Geek
  • Campus Ambassador
  • LeaderBoard
CSEstack

What do you want to Learn Today?

  • Programming
    • C/C++
    • Python
    • Java
    • HTML CSS
    • SQL
  • CSE Subject
    • Compiler Design
    • Computer Network
    • COA
    • Data Structure
    • DBMS
    • Operating System
    • Theory of Automata
    • Web Technology
  • Linux
  • Trend
    • Artificial Intelligence (AI)
    • Big Data
    • Cloud Computing
    • Machine Learning (ML)
  • GATE CSE 2020
    • Self Study Plan
    • Complete Syllabus
    • FREE Test Series
    • Topper Interview (AIR 15)
    • Recommended Books by Topper
  • Career
    • Placement Interview
    • Jobs
    • Aptitude
    • Quiz
  • Material
    • Recommended Books
    • Software Installation
  • Contribute to Us
    • Write for Us
    • Submit Source Code or Program
    • Share Interview Experience
  • Tools

Object Oriented Programming Concepts | Asked in Many Interviews

Heena Rajpal/07 Aug, 16/6093/2
Code

The most basic concept of object oriented programming, as the name suggests, is an object. Since the concept of object oriented programming came into the picture, programming could be closer to the real world. Here, the objects are analogous to real life objects.

The major concepts of object oriented programming include:

  • Class
  • Object
  • Encapsulation
  • Abstraction
  • Inheritance
  • Polymorphism

 

“Object is a real-world entity.”

You may look around to find various objects like pen, table, fan etc. In fact, you are also an object.

Every object has three basic characteristics:

  • Identity
  • State
  • Behavior
Identity uniquely identifies an object.
For e.g.: your roll number uniquely identifies you.

The current condition of an object is called its state.
For e.g.: a fan can have two states, on and off.

The things that can be done by an object are called its behaviors.
For e.g.: a pen can write, so writing is its behavior.

A formal definition of an object says – “Object is an instance of the class.”

This brings us to the second concept of object oriented programming – ‘Class’. If we group a number of similar objects into one unit, we obtain a class.

For e.g.: a group of people like you can form a class called ‘Student’. 
In other words, Student class has various instances (or objects) and one of them is you.

Every student has certain properties like name, roll no., class etc. 
Also, students can perform various operations 
like ‘get fee structure’, ‘pay fee’, ‘get result’ etc.

These properties are attributes of a class and the operations are methods or behavior of a class.

If you are preparing for placement, you will come across many interview questions on object oriented programming concepts. Here are some basic questions.

Concepts of Object Oriented Programming:

What is encapsulation?

The process of grouping these attributes and behaviors into a single unit is known as encapsulation.

Wha is abstraction?

Now, a student can have many attributes like name, age, DOB, address, contact no., gender, height, weight, complexion, favorite food etc.
But an educational institution won’t ask for all these attributes from a student. It will ask for only necessary attributes like name, age, DOB, address, contact no. and gender. It has nothing to do with your height, weight, complexion, food preferences etc. This process of sustaining only essential and relevant information and discarding the rest is known as abstraction.

What is Inheritance?

When once class acquires properties of another class, it is known as inheritance.The class that gives the properties is called superclass and the class that acquires the properties is called subclass.

For e.g. Animal can be a super class. 
Its subclasses can be Herbivores, Carnivores and Omnivores. 
The common properties like 4 legs can be placed in Animal class. 

The behavior ‘eats grass’ is only for Herbivores, so it cannot be kept in Animal class. 
However, if Herbivores inherits Animal class, 
the property that Herbivores have 4 legs does not need to be redefined.

The major benefit of inheritance is reusability of code.

What is Polymorphism?

The last major concept of object oriented programming is the polymorphism. ‘Poly’ means many and ‘morph’ means forms. This means it has statements that have many forms.

For e.g.: “greet” is a behavior. 

If you ask an Indian to greet, he will say “Namaste”. 
An American may say “Hello”. 
And in France, you’ll come across “Salut”. 

This means that ‘greet’ means different things to different people. This is the concept of polymorphism.

There are two types of polymorphism:

  • Static/ Compile-time polymorphism
  • Dynamic/ Run-time polymorphism

The type depends on whether the meaning of the message is determined at compile time or run time.

Programming

Related Posts

Jobs

Top 5 Computer Programmer Skills You Require to Land Better Jobs

C / C++CodeJAVAPython

5 Programming Languages to Get High Paying Jobs in 2019

C / C++CodePython

Calling C Functions from Python [Step by Step Procedure]

Heena Rajpal
Heena Rajpal is pursuing Computer Science Engineering from Indore. She has a knack for writing and an inquisitive outlook towards Computer Science fields like Database Management Systems, Object Oriented Programming and languages like C, C++, JAVA, Python, HTML etc.

Comments

  • Reply
    Swapnil jain
    August 8, 2016 at 5:04 pm

    Thanks a lot Mam as I was really facing some issue in understanding this particular concept. It would be great if you can write more about java and python.

  • Reply
    Shivangi Vaidya
    August 9, 2016 at 1:57 pm

    This language and the examples used, truly helped me clear my concepts. Madam, kindly inform me if you take any private tuition classes. I am very much interested.

Leave a Reply Cancel reply

Interview Experiences

AccentureAgriChain Akamai Amazon Amdocs American Express Attra Infotech BARC Barclays BlockGrain BYJUS Cisco Cognizant Coupon Dunia Credit Suisse DE Shaw Druva Experis IT Eze Software Factset Fiorano General Electric Incture Technologies Infosys Kasmo Cloud Microsoft MindTree Mu Sigma Numerify Opteamix Oracle Persistent Pole to Win Qualcomm Reliance Riverbed Syntel TCS Tech Mahindra Teradata Terralogic Virtusa Wipro

Interview Questions



You can share your interview experience.

Don’t Miss !

Latest Articles

Cisco Online Test Pattern and Interview Questions for Freshers


[7 Best Tips] How to Make Daily Study Timetable and Stick to It?


Persistent Written Test and Technical Coding Questions [Paper Pattern]


10 Top Website Design Tips for Small Business to Boost Up Your Sales


Main Difference Between remove del and pop in Python List


Tech Mahindra Placement (Online Test | Essay Writing | Interview Questions)


Importance of Career Exploration for High-School Students | Why?


Favorite Topic

AI algorithm array bigdata bit manipulation career Code Computer Network cpp data analytics database data scientist Data Structure db DBMS difference between Django education GATE GATE Topper Interview HTML ibm IBM ISDL interview IP address Java JavaScript Jobs Linked List linux linux cmd nit OOPs Concept os Programming Python python list Qualcomm SOAP sorting stack string vim webbrowser web development

Contribution to Community

  • Contribute to CSEstack Portal
  • Submit Your Source Code or Program
  • Share Your Interview Experience
  • CSEStack Leadership Board
  • Campus Ambassador Program by CSEstack

About CSEstack Portal

  • About CSEStack:
  • Contact Us
  • CSEStack Campus Ambassador
  • Recommended Books by Expert

© 2019 – CSEstack.org. All Rights Reserved.

  • Home
  • Subscribe
  • Contribute Us
    • Share Your Interview Experience
  • Contact Us
  • About Us
    • About CSEStack:
    • Campus Ambassador
  • Forum & Discus
  • Tools for Geek
  • Campus Ambassador
  • LeaderBoard