JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Object Oriented Programming interview questions part 5
Object Oriented Programming interview questions part 5
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. What are automatic variables?
A. Global variables
B. Implicit/temporary variables
C. Local variables
D. System variables
Show Correct Answer
Correct Answer is :
Local variables
2. The memory for automatic variables ___________________
A. Have to be allocated and deallocated explicitly
B. Are allocated and deallocated automatically
C. Is never actually allocated
D. Are never safe
Show Correct Answer
Correct Answer is :
Are allocated and deallocated automatically
3. Scope of an automatic variable _______________
A. Is actually the whole program
B. Is actually never fixed
C. Is always equal to the whole program execution
D. Is actually function or block in which it is defined
Show Correct Answer
Correct Answer is :
Is actually function or block in which it is defined
4. Which among the following is true for automatic variables in general?
A. Automatic variables are invisible to called function
B. Automatic variables are always visible to the called function
C. Automatic variables can’t interact with the called function
D. Automatic variables can’t be variable
Show Correct Answer
Correct Answer is :
Automatic variables are invisible to called function
5. If an automatic variable is created and then a function is called then ________________
A. The automatic variable created gets destroyed
B. The automatic variable doesn’t get destroyed
C. The automatic variable may or may not get destroyed
D. The automatic variable can’t be used in this case
Show Correct Answer
Correct Answer is :
The automatic variable doesn’t get destroyed
6. Where are the automatic variables stored if another function is called in between the execution of program?
A. Heap
B. Queue
C. Stack
D. Temp variable
Show Correct Answer
Correct Answer is :
Stack
7. The static variables of a function ________________
A. Are also automatic variables
B. Are not automatic variables
C. Are made automatic by default
D. Can be made automatic explicitly
Show Correct Answer
Correct Answer is :
Are not automatic variables
8. All variables declared within a block ____________________
A. Are not always automatic
B. Can be made non-automatic
C. Are static by default
D. Are automatic by default
Show Correct Answer
Correct Answer is :
Are automatic by default
9. What values does uninitialized automatic variables contain?
A. Null value
B. Void value
C. Undefined/Garbage
D. Zero value
Show Correct Answer
Correct Answer is :
Undefined/Garbage
10. Constructor of automatic variables is called ____________________
A. When execution reaches the place of declaration of automatic variables
B. When the program is compiled
C. When the execution is just started
D. Just before the execution of program
Show Correct Answer
Correct Answer is :
When execution reaches the place of declaration of automatic variables
11. Does java contain auto or register keywords?
A. Yes, for declaring every type of variable
B. Yes, only to declare cache registers
C. No, because java doesn’t support automatic variables
D. No, java supports local variable concept
Show Correct Answer
Correct Answer is :
No, java supports local variable concept
12. The automatic variables _________________________
A. Must be declared after its use
B. Must be declared before using
C. Must be declared, can be anytime
D. Must not be initialized
Show Correct Answer
Correct Answer is :
Must be declared before using
13. Which error is produced if the automatic variables are used without declaration?
A. Undefined symbol
B. Memory error
C. Type mismatch
D. Statement missing
Show Correct Answer
Correct Answer is :
Undefined symbol
14. In perl, using which operator are the local variables created?
A. Dot
B. Arrow
C. Scope resolution
D. my
Show Correct Answer
Correct Answer is :
my
15. How are automatic variables different from the instance variables?
A. Automatic variables are initialized automatically but instances are not
B. Automatic variables are given zero values initially and not instances
C. Instance variables have to be initialized explicitly and automatic implicitly
D. Instance variables are initialized implicitly while automatic are not
Show Correct Answer
Correct Answer is :
Instance variables are initialized implicitly while automatic are not
16. Which is most appropriate definition of a base class?
A. It is parent of any of its derived class
B. It is child of one of the parent class
C. It is most basic class of whole program
D. It is class with maximum number of members
Show Correct Answer
Correct Answer is :
It is parent of any of its derived class
17. A base class is also known as _____________ class.
A. Basic
B. Inherited
C. Super
D. Sub
Show Correct Answer
Correct Answer is :
Super
18. An abstract class is always a __________ class.
A. Base
B. Derived
C. Template
D. Nested
Show Correct Answer
Correct Answer is :
Base
19. How many base classes can a single class inherit in java?
A. 1
B. 2
C. 3
D. As many as required
Show Correct Answer
Correct Answer is :
1
20. How to make a derived class a base class?
A. Change name of the class
B. Use keyword base
C. Make a class derive from it
D. Can’t be done
Show Correct Answer
Correct Answer is :
Make a class derive from it
Similar Interview Questions
Search for latest jobs
Find Jobs