If you declare an object as null, the garbage collector immediately comes into a
ID: 3539357 • Letter: I
Question
If you declare an object as null, the garbage collector immediately comes into action and frees the memory occupied by the object. a) True b) False Mr. Vijay has written an application without using any thread priorities. When he runs the program, does JVM impose any thread priorities on the code ? a) imposes b) does not impose c) depends on the underlying system d) none A thread enters the dead state after completing its run method or when stop method is called. The stop method sends a ThreadDeath object on to the thread. The ThreadDeath is a subclass of _______. a) Exception b) Error c) both and depends on the source code d) none t1.setPriority(hread.MAX_PRIORITY); t2.setPriority( Thread.MIN_PRIORITY); In the above code t1 and t2 are two threads. Imagine only one thread either t1 or t2 runs at a time on the system. The time taken to execute a certain code by t1 is lessor than t2 as t1 is set to more priority than t2. a) True b) False Color clr = new Color (Color.red); The above statement produces same intensity of red color on any color monitor as Java is platform independent. a) True b) False private float red = 0.5f, green = 0.5f , blue = 0.5f ; public void paint( Graphics g) { g.setColor ( new Color ( red, green, blue) ) ; g.drawString ( g.getColor( ).toString( ), 50, 75 ) ; } What are the color values given by the drawString( ) method of the above program? a) 127, 127, 127 b) 0.5, 0.5, 0.5 c) depends on the underlying system d ) does not compile as the program is error prone e) noneExplanation / Answer
true
impose
error
false
true
c) depends on the underlying system
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.