11. What is the difference between class and structure?
Ans: In class the data members by default are private but in structure they are by default public
12. Define object based programming language?
Ans: Object based programming language support encapsulation and object identity without supporting some important features of OOPs language.
Object based language=Encapsulation + object Identity
13. Define object oriented language?
Ans: Object-oriented language incorporates all the features of object based programming languages along with inheritance and polymorphism.
Example: – c++, java.
Ans: In class the data members by default are private but in structure they are by default public
12. Define object based programming language?
Ans: Object based programming language support encapsulation and object identity without supporting some important features of OOPs language.
Object based language=Encapsulation + object Identity
13. Define object oriented language?
Ans: Object-oriented language incorporates all the features of object based programming languages along with inheritance and polymorphism.
Example: – c++, java.
Advertisement
14. Define OOPs?
Ans: OOP is a method of implementation in which programs are organized as co-operative collection of objects, each of which represents an instance of some class and whose classes are all member of a hierarchy of classes united through the property of inheritance.
15. What is public, protected, and private?
Ans: These are access specifier or a visibility lebels .The class member that has been declared as private can be accessed only from within the class. Public members can be accessed from outside the class also. Within the class or from the object of a class protected access limit is same as that of private but it plays a prominent role in case of inheritance
16. What is a scope resolution operator?
Ans: The scope resolution operator permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope.
Ans: OOP is a method of implementation in which programs are organized as co-operative collection of objects, each of which represents an instance of some class and whose classes are all member of a hierarchy of classes united through the property of inheritance.
15. What is public, protected, and private?
Ans: These are access specifier or a visibility lebels .The class member that has been declared as private can be accessed only from within the class. Public members can be accessed from outside the class also. Within the class or from the object of a class protected access limit is same as that of private but it plays a prominent role in case of inheritance
16. What is a scope resolution operator?
Ans: The scope resolution operator permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope.
Advertisement
17. What do you mean by inheritance?
Ans: The mechanism of deriving a new class (derived) from an old class (base class) is called inheritance. It allows the extension and reuse of existing code without having to rewrite the code from scratch.
18. What do you mean by implicit conversion?
Ans: Whenever data types are mixed in an expression then c++ performs the conversion automatically.
Here smaller type is converted to wider type.
Example- in case of integer and float integer is converted into float type.
19. What is abstraction?
Ans: The technique of creating user-defined data types, having the properties of built-in data types and a set of permitted operators that are well suited to the application to be programmed is known as data abstraction. Class is a construct for abstract data types (ADT).
20. What is encapsulation?
Ans: It is the mechanism that wraps the data and function it manipulates into single unit and keeps it safe from external interference.
Ans: The mechanism of deriving a new class (derived) from an old class (base class) is called inheritance. It allows the extension and reuse of existing code without having to rewrite the code from scratch.
18. What do you mean by implicit conversion?
Ans: Whenever data types are mixed in an expression then c++ performs the conversion automatically.
Here smaller type is converted to wider type.
Example- in case of integer and float integer is converted into float type.
19. What is abstraction?
Ans: The technique of creating user-defined data types, having the properties of built-in data types and a set of permitted operators that are well suited to the application to be programmed is known as data abstraction. Class is a construct for abstract data types (ADT).
20. What is encapsulation?
Ans: It is the mechanism that wraps the data and function it manipulates into single unit and keeps it safe from external interference.