Introduction to C++ Question And Answers - letsbug
1. What is meant by OOP?
Answer:
- OOP means Object Oriented Programming. Object Oriented Programming is a new way of organizing code and data that promises increased control over the complexity of the software development process.
- Object oriented development is a conceptual process independent of the a programming language until the final stage.
- Object Oriented means to organize software as collection of discrete, real-world objects that incorporate both data structure and behavior.
- Object Oriented Programming(OOP) allows us to decompose a problem into a number of entities called objects.
2. List out different concepts of OOP?
Answer:
- Classes
- A class is a group of object with similar properties (attributes), common behaviour(operations), common relationships to other objects and common semantics.
- Classes are user defined datatypes and behave like the built-in type of programming languages.
- Objects
- Objects are discrete, distinguishable antities.
- Objects are basic run-time entities.
- Data Abstraction
- Abstraction is the selective examination of certain aspect of a problem.
- The goal of abstraction is to isolate those aspects that are important for some purpose and suppress those aspects that are unimportant.
- Encapsulation
- The wrapping up of data and functions into a single unit i.e class is called as Encapsulation.
- Inheritance
- In inheritance process we can create new classes known as derived or child or sub-class from the existing class known as base or parent or super class.
- Polymorphism
- Polymorphism means one thing different or many forms i.e the ability to take more than one form.
- Dynamic Binding
- Binding refers to the linking of procedure call to the code to be executed in response to the call. This like can by physical or conceptual connection between object instances.
- Message passing
- The act of communicating with an object to get something done is called as Message passing.
- OOP consists of set of objects that communicate with each other.
3. What is Class?
Answer:
- A class is a group of objects with similar properties (attributes), common behaviour(operations), common relationships to other objects and common semantics.
- Classes are user defined datatypes and behave like the built-in types of programming language.
- The entire set of data and code of an object can by made use defined data type with the help of class.
- Once, a class has been defined we can create any number of objects belonging to the same class. Person, company, process, window are some examples of classes.
4. Define the term Polymorphism in detail.
Answer:
- In Polymorphism, "poly" means many and "orphism" means form which forms many forms of one things.
- In other words, "Polymorphism means one thing different or many forms" i.e the ability to take more than one form.
- Polymorphism plays an important role in allowing objects having different internal structures to share the same external interfaces.
- In OOP, Polymorphism refer to the fact that a single operation can have different behaviour in different objects. In other words, different objects react differently to same message.
- For example, consider the operation of addition. For two numbers, the number, the addition should generate the sum. The operation of addition is expressed by a single operator +. You can use the expression x + y to denote the sum of x and y for many different types of x and y integers, floating point numbers and even the concatenation of two strings.
Answer:
- In Polymorphism, "poly" means many and "orphism" means form which forms many forms of one things.
- In other words, "Polymorphism means one thing different or many forms" i.e the ability to take more than one form.
- Polymorphism plays an important role in allowing objects having different internal structures to share the same external interfaces.
- In OOP, Polymorphism refer to the fact that a single operation can have different behaviour in different objects. In other words, different objects react differently to same message.
- For example, consider the operation of addition. For two numbers, the number, the addition should generate the sum. The operation of addition is expressed by a single operator +. You can use the expression x + y to denote the sum of x and y for many different types of x and y integers, floating point numbers and even the concatenation of two strings.
5. What is C++?
Answer:
- C++ is a general purpose programming language which has been derived from C programming Language.
- C+ could be considered as superset of C language with extension and improvements with object oriented features included in it. C++ runs on a variety of platforms, such as windows, Mac OS, UNIX, LINUX etc.
- C++ is regarded as a middle-level language features.
- C++ is popular language because of following reasons
- C++ is ideally suited for development of reusable software.
- C++ is highly flexible language with versatility.
Comments
Post a Comment