miércoles, 14 de abril de 2010

Publicar una parte de Preguntas últimasSCJP 310-035

Exam 310-035 SUN Certified PROGRAMMER FOR THEJAVA 2 PLATFORM 1.4

1.Which statement is true?
A.Memory is reclaimed by calling Runtime.gc().
B.Objects are not collected if they are accessible from live threads.
C.Objects that have finalize() methods are never garbage collected.
D.Objects that have finalize() methods always have their finalize() methods called before the program
ends.
E.An OutOfMemory error is only thrown if a single block of memory cannot be found that is large enough
for a particular requirement.
Correct:B

2.Which statement is true?
A.To call the wait() method, a thread must own the lock of the current thread.
B.To call the wait() method, a thread must own the lock of the object on which the call is to be made.
C.To call the join() method, a thread must own the lock of the object on which the call is to be made.
D.To call the sleep() method, a thread must own the lock of the object on which the call is to be made.
E.To call the yield() method, a thread must own the lock of the object on which the call is to be made.
Correct:B

3.Which two conditions can place the thread in a runnable state after wait() has been called on an
object in that thread? (Choose two.)
A.A thread calls resume() on the thread.
B.A higher priority thread invokes yield().
C.A higher priority thread invokes sleep();
D.A thread calls notify() on the same object.
E.A thread calls notifyAll() on the same object.
Correct:D E

4.Given: 1. public class Foo implements Runnable { 2. public void run() { 3.
System.out.println("Running"); 4. } 5. public void start() { 6. System.out.println("Starting"); 7. } 8.
public static void main(String[] args) { 9. new Thread(new Foo()).start(); 10. } 11. } What is theresult?
A.Running
B.Starting
C.Compilation fails.
D.The code runs with no output.
E.An exception is thrown at runtime.
Correct:A

puedes encontrar más en killtest.es. El material te garantiza pasar 100 por ciento de una vez.

No hay comentarios:

Publicar un comentario