JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Object Oriented Programming interview questions part 2
Object Oriented Programming interview questions part 2
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Which among the following best defines the abstract methods?
A. Functions declared and defined in base class
B. Functions only declared in base class
C. Function which may or may not be defined in base class
D. Function which must be declared in derived class
Show Correct Answer
Correct Answer is :
Functions only declared in base class
2. Which among the following is true?
A. The abstract functions must be only declared in derived classes
B. The abstract functions must not be defined in derived classes
C. The abstract functions must be defined in base and derived class
D. The abstract functions must be defined either in base or derived class
Show Correct Answer
Correct Answer is :
The abstract functions must be only declared in derived classes
3. How are abstract functions different from the abstract functions?
A. Abstract must not be defined in base class whereas virtual function can be defined
B. Either of those must be defined in base class
C. Different according to definition
D. Abstract functions are faster
Show Correct Answer
Correct Answer is :
Abstract must not be defined in base class whereas virtual function can be defined
4. Which among the following is correct?
A. Abstract functions should not be defined in all the derived classes
B. Abstract functions should be defined only in one derived class
C. Abstract functions must be defined in base class
D. Abstract functions must be defined in all the derived classes
Show Correct Answer
Correct Answer is :
Abstract functions must be defined in all the derived classes
5. It is _________________________ to define the abstract functions.
A. Mandatory for all the classes in program
B. Necessary for all the base classes
C. Necessary for all the derived classes
D. Not mandatory for all the derived classes
Show Correct Answer
Correct Answer is :
Necessary for all the derived classes
6. The abstract function definitions in derived classes is enforced at _________
A. Runtime
B. Compile time
C. Writing code time
D. Interpreting time
Show Correct Answer
Correct Answer is :
Compile time
7. What is this feature of enforcing definitions of abstract function at compile time called?
A. Static polymorphism
B. Polymorphism
C. Dynamic polymorphism
D. Static or dynamic according to need
Show Correct Answer
Correct Answer is :
Dynamic polymorphism
8. What is the syntax for using abstract method?
A.
abstract
method_name (parameter)
B. abs
method name (parameter)
C.
abstract return-type method name (parameter)
D.
abstract
method name (parameter)
Show Correct Answer
Correct Answer is :
abstract
method_name (parameter)
9. If a function declared as abstract in base class doesn’t have to be defined in derived class then ______
A. Derived class must define the function anyhow
B. Derived class should be made abstract class
C. Derived class should not derive from that base class
D. Derived class should not use that function
Show Correct Answer
Correct Answer is :
Derived class should be made abstract class
10. Static methods can’t be made abstract in java.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
11. Which among the following is true?
A. Abstract methods can be static
B. Abstract methods can be defined in derived class
C. Abstract methods must not be static
D. Abstract methods can be made static in derived class
Show Correct Answer
Correct Answer is :
Abstract methods must not be static
12. Which among the following is correct for abstract methods?
A. It must have different prototype in the derived class
B. It must have same prototype in both base and derived class
C. It must have different signature in derived class
D. It must have same return type only
Show Correct Answer
Correct Answer is :
It must have same prototype in both base and derived class
13. If a class have all the abstract methods the class will be known as ___________
A. Abstract class
B. Anonymous class
C. Base class
D. Derived class
Show Correct Answer
Correct Answer is :
Abstract class
14. The abstract methods can never be ___________ in a base class.
A. Private
B. Protected
C. Public
D. Default
Show Correct Answer
Correct Answer is :
Private
15. The abstract method definition can be made ___________ in derived class.
A. Private
B. Protected
C. Public
D. Private, public, or protected
Show Correct Answer
Correct Answer is :
Private, public, or protected
16. Which among the following best defines abstraction?
A. Hiding the implementation
B. Showing the important data
C. Hiding the important data
D. Hiding the implementation and showing only the features
Show Correct Answer
Correct Answer is :
Hiding the implementation and showing only the features
17. Hiding the implementation complexity can:
A. Make the programming easy
B. Make the programming complex
C. Provide more number of features
D. Provide better features
Show Correct Answer
Correct Answer is :
Make the programming easy
18. Class is _________ abstraction
A. Object
B. Logical
C. Real
D. Hypothetical
Show Correct Answer
Correct Answer is :
Logical
19. Object is ________ abstraction
A. Object
B. Logical
C. Real
D. Hypothetical
Show Correct Answer
Correct Answer is :
Real
20. Abstraction gives higher degree of ________
A. Class usage
B. Program complexity
C. Idealized interface
D. Unstable interface
Show Correct Answer
Correct Answer is :
Idealized interface
Similar Interview Questions
Search for latest jobs
Find Jobs