Interview questions
Computer interview questions – page 70
3,888 questions. Tap “Show answer” to check yourself.
-
Class access specifiers are also known as ____
- A.Specifications
- B.Class depth
- C.Visibility labels
- D.None of these
Show answer
C. Visibility labels
-
____ are the functions that perform specific task in a class.
- A.Data functions
- B.Concrete functions
- C.Member functions
- D.Data members
Show answer
C. Member functions
-
The class body has ___ access specifies.
- A.1
- B.2
- C.3
- D.4
Show answer
C. 3
-
The members declared as ____ can only be accessed within the class.
- A.Private
- B.Public
- C.Protected
- D.Class
Show answer
A. Private
-
Class comprises ____
- A.Data members
- B.Member functions
- C.Both (a) and (b)
- D.None of these
Show answer
C. Both (a) and (b)
-
When objects of a class are created, separate memory is allocated for?
- A.Member functions only
- B.Member variables only
- C.Both a and b
- D.Neither functions nor variables
Show answer
B. Member variables only
-
The class access specifier used to access friend function is ____
- A.Private
- B.Public
- C.Protected
- D.Both (b) and (c)
Show answer
B. Public
-
Which is the base class of the class heavy_vehicle?
- A.Bus
- B.Heavy_vehicle
- C.Vehicle
- D.Both (a) and (c)
Show answer
C. Vehicle
-
Which of the following is a user defined data type?
- A.Protected
- B.Public
- C.Object
- D.Class
Show answer
D. Class
-
The lifetime of a static member variable is same as ___
- A.Lifetime of the program
- B.The public variable of any object
- C.The private of variable of any object
- D.The first object of its class
Show answer
A. Lifetime of the program
-
Which one of the following language features classes?
- A.C
- B.C++
- C.Basic
- D.None
Show answer
B. C++
-
The return type of a member function of a class can be ____
- A.A valid C++ data type or object data type
- B.Only a valid C++ data type
- C.Only object data type
- D.None of the given
Show answer
A. A valid C++ data type or object data type
-
Private, public and protected are all ____
- A.Access specifiers
- B.C++ variables
- C.Control structures of C++
- D.Derived class members
Show answer
A. Access specifiers
-
Which is not inherited from the base class?
- A.Data members
- B.Constructor
- C.Function
- D.Object
Show answer
B. Constructor
-
When a class is derived by access specifier public, the protected members of base class are derived as ____ of derived class.
- A.Private members
- B.Public members
- C.Protected members
- D.None
Show answer
C. Protected members
-
When a sub class inherits only from one base class, it is known as ___
- A.Single inheritance
- B.Double inheritance
- C.Hierarchical inheritance
- D.None
Show answer
A. Single inheritance
-
In inheritance, the newly created classes are ___
- A.Function
- B.Super class
- C.Derived class
- D.Base class
Show answer
C. Derived class
-
The default visibility mode while inheriting members of a base class is ____
- A.Extended public
- B.Public
- C.Protected
- D.Private
Show answer
D. Private
-
Single, multiple, multilevel, hybrid and hierarchical are all types of ____
- A.Overloading
- B.Encapsulation
- C.Inheritance
- D.Polymorphism
Show answer
C. Inheritance
-
When a class is inherited by public visibility mode the public members of base class are derived as ____ of derived class.
- A.Public members
- B.Protected members
- C.Private members
- D.None
Show answer
A. Public members
-
Classes used only for deriving other classes are called ___
- A.Abstract classes
- B.Derived classes
- C.Public classes
- D.Objects
Show answer
A. Abstract classes
-
A derived class that inherits from multiple base class is known as ____
- A.Single inheritance
- B.Multiple inheritance
- C.Multilevel inheritance
- D.Hybrid inheritance
Show answer
B. Multiple inheritance
-
The process of creating new data types from existing data type is called as ____
- A.Encapsulation
- B.Overloading
- C.Polymorphism
- D.Inheritance
Show answer
D. Inheritance
-
In inheritance, protected members of base class are inherited as ____ when private access specifier is used.
- A.Public members
- B.Private members
- C.Protected members
- D.Not inherited at all
Show answer
B. Private members
-
Reusability of code, code sharing, consistency of interface are all advantages of ____
- A.Encapsulation
- B.Inheritance
- C.Polymorphism
- D.Overloading
Show answer
B. Inheritance
-
The class created from an existing base class is called ___
- A.Second class
- B.New class
- C.Derived class
- D.Rich class
Show answer
C. Derived class
-
The class from which the other classes are derived is called as ____
- A.Objects
- B.Functions
- C.Sub-class
- D.Object class
Show answer
B. Functions
-
In C++ functions are also called ___
- A.Definitions
- B.Concepts
- C.Methods
- D.Organizers
Show answer
C. Methods
-
Which of the following is not a valid class specifier?
- A.Private
- B.Pointer
- C.Public
- D.Protected
Show answer
B. Pointer
-
OOP stands for ___
- A.Object to Object Programming
- B.Object Oriented Programming
- C.Online Objects Programming
- D.Object Oriented Processes
Show answer
B. Object Oriented Programming