JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Object Oriented Programming interview questions part 6
Object Oriented Programming interview questions part 6
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. If a base class is being derived by two other classes, which inheritance will that be called?
A. Single
B. Multiple
C. Multi-level
D. Hierarchical
Show Correct Answer
Correct Answer is :
Hierarchical
2. Which among the following must be in a base class?
A. Data members
B. Member functions
C. Access specifiers
D. Nothing
Show Correct Answer
Correct Answer is :
Nothing
3. Which type of members can’t be accessed in derived classes of a base class?
A. Protected
B. Private
C. Public
D. All can be accessed
Show Correct Answer
Correct Answer is :
Private
4. If a class is enclosing more than one class, than it can be called as base class of those classes.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
FALSE
5. Base class have ________________ of abstraction.
A. Higher degree
B. Lower degree
C. Intermediate
D. Minimum degree
Show Correct Answer
Correct Answer is :
Lower degree
6. Always the base class constructors are called ___________ constructor of derived class.
A. Before
B. After
C. Along
D. According to priority of
Show Correct Answer
Correct Answer is :
Before
7. Can we call methods of base class using constructor of the derived class?
A. Yes, always
B. Yes, but not always
C. No, never
D. No, but we can call in some cases
Show Correct Answer
Correct Answer is :
Yes, always
8. If a base class is inherited from another class and then one class derives it, which inheritance is shown?
A. Multiple
B. Single
C. Hierarchical
D. Multi-level
Show Correct Answer
Correct Answer is :
Multi-level
9. How many base classes can a single derived class have in C++?
A. 1
B. 2
C. 3
D. As many as required
Show Correct Answer
Correct Answer is :
As many as required
10. If a base class is added with few new members, its subclass must also be modified. (True/False)
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
FALSE
11. Which among the following is true for class exceptions?
A. Only base class can give rise to exceptions
B. Only derived class can give rise to exceptions
C. Either base class or derived class may produce exceptions
D. Both base class and derived class may produce exceptions
Show Correct Answer
Correct Answer is :
Both base class and derived class may produce exceptions
12. If both base and derived class caught exceptions ______________
A. Then catch block of derived class must be defined before base class
B. Then catch block of base class must be defined before the derived class
C. Then catch block of base and derived classes doesn’t matter
D. Then catch block of base and derived classes are not mandatory to be defined
Show Correct Answer
Correct Answer is :
Then catch block of derived class must be defined before base class
13. Which among the following is true?
A. If catch block of base class is written first, it is compile time error
B. If catch block of base class is written first, it is run time error
C. If catch block of base class is written first, derived class catch block can’t be reached
D. If catch block of base class is written first, only derived class catch block is executed
Show Correct Answer
Correct Answer is :
If catch block of base class is written first, derived class catch block can’t be reached
14. The catching of base class exception ___________________________ in java.
A. After derived class is not allowed by compiler
B. Before derived class is not allowed by compiler
C. Before derived class is allowed
D. After derived class can’t be done
Show Correct Answer
Correct Answer is :
Before derived class is not allowed by compiler
15. If catching of base class exception is done before derived class in C++ ________________
A. It gives compile time error
B. It doesn’t run the program
C. It may give warning but not error
D. It always gives compile time error
Show Correct Answer
Correct Answer is :
It may give warning but not error
16. How many catch blocks can a class have?
A. Only 1
B. 2
C. 3
D. As many as required
Show Correct Answer
Correct Answer is :
As many as required
17. Since which version of java is multiple exception catch was made possible?
A. Java 4
B. Java 5
C. Java 6
D. Java 7
Show Correct Answer
Correct Answer is :
Java 7
18. To catch more than one exception in one catch block, how are the exceptions separated in the syntax?
A. Vertical bar
B. Hyphen
C. Plus
D. Modulus
Show Correct Answer
Correct Answer is :
Vertical bar
19. If a catch block accepts more than one exceptions then __________________
A. The catch parameters are not final
B. The catch parameters are final
C. The catch parameters are not defined
D. The catch parameters are not used
Show Correct Answer
Correct Answer is :
The catch parameters are final
20. Which among the following handles the undefined class in program?
A. ClassNotFound
B. NoClassException
C. ClassFoundException
D. ClassNotFoundException
Show Correct Answer
Correct Answer is :
ClassNotFoundException
Similar Interview Questions
Search for latest jobs
Find Jobs