JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Object Oriented Programming interview questions part 8
Object Oriented Programming interview questions part 8
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Which of the following is not type of class?
A. Abstract Class
B. Final Class
C. Start Class
D. String Class
Show Correct Answer
Correct Answer is :
Start Class
2. Class is pass by _______
A. Value
B. Reference
C. Value or Reference, depending on program
D. Copy
Show Correct Answer
Correct Answer is :
Reference
3. What is default access specifier for data members or member functions declared within a class without any specifier, in C++ ?
A. Private
B. Protected
C. Public
D. Depends on compiler
Show Correct Answer
Correct Answer is :
Private
4. Which is most appropriate comment on following class definition : class Student { int a; public : float a; };
A. Error : same variable name can’t be used twice
B. Error : Public must come first
C. Error : data types are different for same variable
D. It is correct
Show Correct Answer
Correct Answer is :
Error : same variable name can’t be used twice
5. Which is known as generic class?
A. Abstract class
B. Final class
C. Template class
D. Efficient Code
Show Correct Answer
Correct Answer is :
Template class
6. Size of a class is :
A. Sum of size of all the variables declared inside the class
B. Sum of size of all the variables along with inherited variables in the class
C. Size of largest size of variable
D. Classes doesn’t have any size
Show Correct Answer
Correct Answer is :
Classes doesn’t have any size
7. Which class can have member functions without their implementation?
A. Default class
B. String class
C. Template class
D. Abstract class
Show Correct Answer
Correct Answer is :
Abstract class
8. Which of the following describes a friend class?
A. Friend class can access all the private members of the class, of which it is a friend
B. Friend class can only access protected members of the class, of which it is a friend
C. Friend class don’t have any implementation
D. Friend class can’t access any data member of another class but can use it’s methods
Show Correct Answer
Correct Answer is :
Friend class can access all the private members of the class, of which it is a friend
9. What is scope of a class nested inside another class?
A. Protected scope
B. Private scope
C. Global scope
D. Depends on access specifier and inheritance used
Show Correct Answer
Correct Answer is :
Depends on access specifier and inheritance used
10. Class with main() function can be inherited (True/False)
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
11. Which among the following is false, for member function of a class?
A. All member functions must be defined
B. Member functions can be defined inside or outside the class body
C. Member functions need not be declared inside the class definition
D. Member functions can be made friend to another class using friend keyword
Show Correct Answer
Correct Answer is :
Member functions need not be declared inside the class definition
12. Which syntax for class definition is wrong?
A. class student{ };
B. student class{ };
C. class student{ public: student(int a){ } };
D. class student{ student(int a){} };
Show Correct Answer
Correct Answer is :
student class{ };
13. Which of the following pairs are similar?
A. Class and object
B. Class and structure
C. Structure and object
D. Structure and functions
Show Correct Answer
Correct Answer is :
Class and structure
14. Which among the following is false for class features?
A. Classes may/may not have both data members and member functions
B. Class definition must be ended with a colon
C. Class can have only member functions with no data members
D. Class is similar to union and structures
Show Correct Answer
Correct Answer is :
Class definition must be ended with a colon
15. Instance of which type of class can’t be created?
A. Anonymous class
B. Nested class
C. Parent class
D. Abstract class
Show Correct Answer
Correct Answer is :
Abstract class
16. What are constant member functions?
A. Functions which doesn’t change value of calling object
B. Functions which doesn’t change value of any object inside definition
C. Functions which doesn’t allow modification of any object of class
D. Functions which doesn’t allow modification of argument objects
Show Correct Answer
Correct Answer is :
Functions which doesn’t change value of calling object
17. Which keyword must be used to declare a member function as a constant member function?
A. Constant
B. Const
C. FunctionConst
D. Unchanged
Show Correct Answer
Correct Answer is :
Const
18. Which objects can call the const functions?
A. Only const objects
B. Only non-const objects
C. Both const and non-const objects
D. Neither const not non-const objects
Show Correct Answer
Correct Answer is :
Both const and non-const objects
19. Non-const functions _______________________
A. Can be called only from non-const object
B. Can be called only from const object
C. Can be called both by const and non-const object
D. Can’t be called with object
Show Correct Answer
Correct Answer is :
Can be called only from non-const object
20. Which is a correct condition on const member functions?
A. Const member functions can’t call non-const member functions
B. Const member functions can’t call any other function
C. Const member functions can call only the functions which are neither const nor non-const
D. Const member functions can call only data members of call not member functions
Show Correct Answer
Correct Answer is :
Const member functions can’t call non-const member functions
Similar Interview Questions
Search for latest jobs
Find Jobs