LATEST

Wednesday, April 29, 2020

INTRODUCTION TO CLASSES AND METHODS MCQS 05

INTRODUCTION TO CLASSES AND METHODS MCQS 05

1) Java memory management mechanism garbage collects objects which are no longer referenced
a true                    
b.false
Ans: a.

2) are objects referenced by a variable candidates for garbage collection when the variable goes out of scope?
a yes                   
b. no
Ans: a.

3) Java's garbage collector runs as a ___ priority thread waiting for __priority threads to relinquish the processor.
a.high                        
b.low
c. both
Ans:c. 


4) The garbage collector will run immediately when the system is out of memory
a.true                       
b.false
Ans: a. 

 
5) You can explicitly drop a object reference by setting the value of a variable whose data type is a reference type to ___
Ans: null 

 
6) When might your program wish to run the garbage collecter?
a. before it enters a compute-intense section of code
b. before it enters a memory-intense section of code
c. before objects are finalized
d. when it knows there will be some idle time
e. a,b, and d
Ans: e

7) For externalizable objects the class is solely responsible for the external format of its contents
a.true                 
b.false
Ans: a 

 
8) When an object is stored, are all of the objects that are reachable from that object stored as well?
a.true                
b.false
Ans: a

9) The default__ of objects protects private and trancient data, and supports the __ of the classes
a.evolution                   
b.encoding
c. both
Ans:c.

10) Which are keywords in Java?
a) NULL          
b) size of 
c) friend        
d) extends      
e) synchronized
Ans : d and e

No comments:

Post a Comment