classes objects Interview Questions and Answers
Ques:- _____ of a class are data variables that represent the features or properties of a class.
A. Access specifiers
B. Visibility labels
C. Member functions
D. Data members
Ques:- Declaration and function definitions are two specifications of which of the following
A. Comments
B. Class
C. Data type
D. None of the given
Ques:- The members that can also be accessed from outside the class should be declared as
A. Protected
B. Private
C. Public
D. None of these
Ques:- Members of a class are classified as
A. Data functions and member functions
B. Data hiding and data abstraction
C. Data variables and data hiding
D. Data members and member function
Ques:- void sum:: input ()
The above line tells
The above line tells
A. function input is sub function of sum
B. function sum is sub function of input
C. function input is declared within the class sum
D. function sum is declared within the class input
Ques:- Which of the following statements in NOT true?
A. A non member function cannot access the private data of a class
B. The return type of a member function cannot be object data type
C. Several different classes can use the same function name
D. Member functions can be of static type
Ques:- int ex:: output ()
Which of the following is true with reference to the above line?
Which of the following is true with reference to the above line?
A. The function output returns integer data type
B. The function output returns ex type of data
C. The class output returns integer type of data
D. The function ex returns integer type of data
Ques:- The body of the class starts and ends with
A. Braces i.e.., {}
B. Semi colon(;)
C. Start and stop
D. Begin and end
Ques:- Data abstraction in C++ is achieved by
A. Encapsulation()
B. Data Hiding()
C. Polymorphism()
D. Inheritance()
Ques:- Declaration of class member are declared as private can be accessed only
A. separately in another class
B. inside or outside the class
C. outside the class
D. within class
Ques:- The private data of a class can be accessed
A. only by member functions of its own class and friend functions
B. only by member functions of its own class
C. only by friend functions
D. by any function
Ques:- The member functions declared under which scope can be accessed by the objects.
A. protected
B. global
C. private
D. public
Ques:- Data hiding refers to _____
A. not giving names to data
B. not specifying members and functions of a class
C. declaring members as public
D. members and functions of a class are not accessible by members of outside class
Ques:- The class members declared _____ can be accessed only within the class and the members of the inherited classes.
A. protected
B. unprotected
C. public
D. private
Ques:- The members of a class are accessed using ___
A. New operator
B. Dot operator
C. + operator
D. Size of operator
Ques:- By default class members are treated as ____
A. Public
B. Private
C. Protected
D. Unprotected
Ques:- The binding of data and functions together into a single entity is known as ____
A. Inheritance
B. Encapsulation
C. Overloading
D. Polymorphism
Ques:- Which of the following is a way to bind the data and its associated functions together?
A. Methods
B. Class
C. Data
D. Functions