• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

help me for these questions

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi :
I have some questions which are difficult to me. Please give a hand.
1) Given:
1.public class X {
2. public void m(Object x) {
3. x = new Integer(99);
4. Integer y = (Integer)x;
5. y = null;
6. System.out.println("x is" + x);
7. }
8.}
When is the Integer object, created in line 3, eligible for garbage collection?
A never
B just after line 4
C just after line 5
D just after line 6 (that is, as the method returns)
when the calling method sets the argument it passed into this method to null
2)The way to accumulate drawn objects on the screen is to:





a) Call paint() directly

b) Call paint() from within update()

c) Call update() from within repaint()

d) Call update() from within paint()

e) Call accumulate() from within paint()


Single Select - Please select the best answer (one and only one choice must be selected).

3)AWT components get their look and feel from:





a) Programmable painting support classes

b) Peer classes

c) SWING classes

d) JVM drawing primitives


Single Select - Please select the best answer (one and only one choice must be selected).
4)With respect to User and Daemon threads:





a) Daemon threads can not be destroyed

b) Running User threads prevent a JVM from terminating program

c) Running Daemon threads prevent a Java VM from terminating program

d) Daemon threads can not be grouped together

e) The JVM can terminate program when only daemon threads are running


Multiple Select - Please select all of the correct answers (this question has 2 correct choices).


 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi zhou chuanhong:
I think the answers would be........
1)
D) just after line 6 (that is, as the method returns)
when the calling method sets the argument it passed into this method to null
2)
b) Call paint() from within update()

3)

a) Programmable painting support classes
(I am not sure about this)

4)
b) Running User threads prevent a JVM from terminating program
e) The JVM can terminate program when only daemon threads are running

Siva.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI ZHOU & SIVALINGAM,
ANSWERS FOR ZHOU'S QUESTIONS ARE
1. D
2. C
3. B
D. BE
 
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic