AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


READ Free Dumps For Oracle- 1z0-804





Question ID 21439

Which two are true about Singletons?

Option A

A Singleton must implement serializable.

Option B

A Singleton has only the default constructor.

Option C

A Singleton implements a factory method.

Option D

A Singleton improves a class's cohesion.

Option E

Singletons can be designed to be thread-safe.

Correct Answer C,E
Explanation The Singleton Pattern is one of the commonly used design templates when there needs to be a control on how an object can be created. This design pattern proposes that at any time there can only be one instance of a singleton (object) created by the JVM. The Singleton class's default constructor is made private, which prevents the direct instantiation of the object by others (Other Classes).) E: The Singleton Pattern makes unit testing far more difficult, as it introduces global state into an application. It should also be noted that this pattern reduces the potential for parallelism within a program, because access to the singleton in a multi-threaded context must be serialised, e.g., by locking.


Question ID 21440

What are two differences between Callable and Runnable?

Option A

A Callable can return a value when executing, but a Runnable cannot.

Option B

A Callable can be executed by a ExecutorService, but a Runnable cannot.

Option C

A Callable can be passed to a Thread, but a Runnable cannot.

Option D

A Callable can throw an Exception when executing, but a Runnable cannot.

Correct Answer A,D
Explanation Explanation: The Callable interface is similar to Runnable, in that both are designed for classes whose instances are potentially executed by another thread. A Runnable, however, does not return a result and cannot throw a checked exception.

Send email to admin@getfreedumps for new dumps request!!!