JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Object Oriented Programming interview questions part 21
Object Oriented Programming interview questions part 21
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. DataInputStream is derived from ______________________
A. StreamingInput
B. StreamedInput
C. StreameInput
D. StreamInput
Show Correct Answer
Correct Answer is :
StreamInput
2. Which attribute can be used to get the size of an array?
A. Size.Array
B. Array.Size
C. Array_name.length
D. length.Array_name
Show Correct Answer
Correct Answer is :
Array_name.length
3. Number class can’t manipulate ____________________
A. Integer values
B. Float values
C. Byte values
D. Character values
Show Correct Answer
Correct Answer is :
Character values
4. Which function should be used to exit from the program that is provided by System class?
A. exit(int);
B. gc();
C. terminate();
D. halt();
Show Correct Answer
Correct Answer is :
exit(int);
5. Which class contain runFinalization() method?
A. Finalize
B. System
C. Final
D. SystemFinal
Show Correct Answer
Correct Answer is :
System
6. What does load(String)::= function do, in System class?
A. Loads dynamic library for a path name
B. Loads all the dynamic libraries
C. Loads all the Number in string format
D. Loads the processor with calculations
Show Correct Answer
Correct Answer is :
Loads dynamic library for a path name
7. Which is not a System class variable?
A. err
B. out
C. in
D. put
Show Correct Answer
Correct Answer is :
put
8. Which package contains the utility classes?
A. java.lang
B. java.utility
C. java.util
D. java.io
Show Correct Answer
Correct Answer is :
java.util
9. Which among the following best describes the Inheritance?
A. Copying the code already written
B. Using the code already written once
C. Using already defined functions in programming language
D. Using the data and functions into derived segment
Show Correct Answer
Correct Answer is :
Using the data and functions into derived segment
10. How many basic types of inheritance are provided as OOP feature?
A. 4
B. 3
C. 2
D. 1
Show Correct Answer
Correct Answer is :
4
11. Which among the following best defines single level inheritance?
A. A class inheriting a derived class
B. A class inheriting a base class
C. A class inheriting a nested class
D. A class which gets inherited by 2 classes
Show Correct Answer
Correct Answer is :
A class inheriting a base class
12. Which among the following is correct for multiple inheritance?
A. class student{public: int marks;}s; class stream{int total;}; class topper:public student, public stream{ };
B. class student{int marks;}; class stream{ }; class topper: public student{ };
C. class student{int marks;}; class stream:public student{ };
D. class student{ }; class stream{ }; class topper{ };
Show Correct Answer
Correct Answer is :
class student{public: int marks;}s; class stream{int total;}; class topper:public student, public stream{ };
13. Which among the following is correct for hierarchical inheritance?
A. Two base classes can be used to be derived into one single class
B. Two or more classes can be derived into one class
C. One base class can be derived into other two derived classes or more
D. One base class can be derived into only 2 classes
Show Correct Answer
Correct Answer is :
One base class can be derived into other two derived classes or more
14. Which is the correct syntax of inheritance?
A. class derived_classname : base_classname{ /*define class body*/ };
B. class base_classname : derived_classname{ /*define class body*/ };
C. class derived_classname : access base_classname{ /*define class body*/ };
D. class base_classname :access derived_classname{ /*define class body*/ };
Show Correct Answer
Correct Answer is :
class derived_classname : access base_classname{ /*define class body*/ };
15. Which type of inheritance leads to diamond problem?
A. Single level
B. Multi-level
C. Multiple
D. Hierarchical
Show Correct Answer
Correct Answer is :
Multiple
16. Which access type data gets derived as private member in derived class:
A. Private
B. Public
C. Protected
D. Protected and Private
Show Correct Answer
Correct Answer is :
Private
17. If a base class is inherited in protected access mode then which among the following is true?
A. Public and Protected members of base class becomes protected members of derived class
B. Only protected members become protected members of derived class
C. Private, Protected and Public all members of base, become private of derived class
D. Only private members of base, become private of derived class
Show Correct Answer
Correct Answer is :
Public and Protected members of base class becomes protected members of derived class
18. Members which are not intended to be inherited are declared as:
A. Public members
B. Protected members
C. Private members
D. Private or Protected members
Show Correct Answer
Correct Answer is :
Private members
19. While inheriting a class, if no access mode is specified, then which among the following is true? (in C++)
A. It gets inherited publicly by default
B. It gets inherited protected by default
C. It gets inherited privately by default
D. It is not possible
Show Correct Answer
Correct Answer is :
It gets inherited privately by default
20. If a derived class object is created, which constructor is called first?
A. Base class constructor
B. Derived class constructor
C. Depends on how we call the object
D. Not possible
Show Correct Answer
Correct Answer is :
Base class constructor
Similar Interview Questions
Search for latest jobs
Find Jobs