Home C and C++ C Plus Plus interview questions Part 1 OOP
Main Menu
Home
System Verilog
Verilog
Methodologies
Open Vera
Digital Concepts
Verification Basics
Protocols
Scripting
Articles
Videos
Interview Questions
Computer Architechture
C and C++
    - C Plus Plus interview questions
        -- Part 1 OOP
        -- Part 2 Templates
    - Templates in C++
Blog/Article
AsicGuru Blog
Tags Cloud
Ads
Usefull Sites
Know Your IP/Location
Local Information India
Free Classified India
Real Estate India
Object Oriented Programming Basics
Share This Articale:

Q. List few features of object oriented programming.Object oriented programming features:

  • Follows bottom up approach.
  • Emphasis is on data.
  • Programs are divided into objects.
  • Functions and data are bound together.
  • Communication is done through objects.
  • Data is hidden.

Q. What are the basic concepts of OOPs?

The following are the basic concepts of OOPs:
Classes, Objects, Data abstraction and encapsulation, Polymorphism, Inheritance, Message Passing, and Dynamic Binding.

Q. What is a class?
Class is an entity which consists of member data and member functions which operate on the member data bound together.

Q. What is an object?
Objects are instances of classes. Class is a collection of similar kind of objects. When a class is created it doesn’t occupy any memory, but when instances of class is created i.e., when objects are created they occupy memory space.

Q. What is encapsulation?
A1. Encapsulation is welding of code and data together into objects.

Q. What is inheritance?
A2. Inheritance is a mechanism through which a subclass inherits the properties and behavior of its superclass. The derived
class inherits the properties and method implementations of the base class and extends it by overriding methods and adding additional properties and methods.

Q. Explain about multiple inheritance?
Inheritance involves inheriting characteristics from its parents also they can have their own characteristics. In multiple inheritance a class can have characteristics from multiple parents or classes. A sub class can have characteristics from multiple parents and still can have its own characteristics.

Q. What is polymorphism?
A3. In Greek this means "many shapes."As a consequence of inheritance and virtual functions, a single task (for example, drawing
a geometrical shape) can be implemented using the same name (like draw()) and implemented differently (via virtual functions) as each type in object hierarchy requires(circle.draw() or rectangle.draw()). Later, when a polymorphic  object (whose type is not known at compile time) executes the draw() virtual function, the correct implementation is chosen andexecuted at run time.

Q. What is the difference between function overloading and function overriding?
A17. Overloading is a method that allows defining multiple member functions with the same name but different signatures. The compiler will pick the correct function based on the signature. Overriding is a method that allows the derived class to redefine the behavior of member functions which the derived class inherits from a base class. The signatures of both base class member function and derived class member function are the same; however, the implementation and, therefore, the behavior will differ

Q. What are the advantages of OOP?

  • Data hiding helps create secure programs.
  • Redundant code can be avoided by using inheritance.
  • Multiple instances of objects can be created.
  • Work can be divided easily based on objects.
  • Inheritance helps to save time and cost.
  • Easy upgrading of systems is possible using object oriented systems.
Keywords : C++   encapsulation   inheritance   polymorphism  

This Articles is written/submitted by puneet (Puneet Aggarwal). You can also contribute to Asicguru.com. Click here to start


Next >> Part 2 Templates

Because of huge spamming only registered users are allowed to comment. Please Login or Register

 
Login/Register
Register
Sign In
Bookmark
ADS