File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes help me for these questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "help me for these questions" Watch "help me for these questions" New topic
Author

help me for these questions

zhou chuanhong
Greenhorn

Joined: Feb 14, 2001
Posts: 2
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).


Sivalingam Sivasuthan
Ranch Hand

Joined: Jan 12, 2001
Posts: 75
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.


- Siva<br /> Sun Certified Programmer for the Java™2 Platform
ASHISH KUMAR
Greenhorn

Joined: Feb 15, 2001
Posts: 11
HI ZHOU & SIVALINGAM,
ANSWERS FOR ZHOU'S QUESTIONS ARE
1. D
2. C
3. B
D. BE
 
Consider Paul's rocket mass heater.
 
subject: help me for these questions