QUESTION NO: 1
What design pattern does the Drivermanager.getconnection () method characterize?
A. DAO
B. Factory
C. Singleton
D. composition
Answer: B
QUESTION NO: 2
Given the code fragment:
dataFormat df;
Which statement defines a new DataFormat object that displays the default date format for the UK
Locale?
A. df = DateFormat.getDateInstance (DateFormat.DEFAULT, Locale(UK));
B. df = DateFormat.getDateInstance (DateFormat.DEFAULT, UK);
C. df = DateFormat.getDateInstance (DateFormat.DEFAULT, Locale.UK);
D. df = new DateFormat.getDataInstance (DataFormat.DEFAULT, Locale.UK);
E. df = new DateFormat.getDateInstance (DateFormat.DEFAULT, Locale(UK));
Answer: C
QUESTION NO: 3
Given the code fragment:
List<Person> pList = new CopyOnWriteArrayList<Person>();
Which statement is true?
A. Read access to the List should be synchronized.
B. Write access to the List should be synchronized.
C. Person objects retrieved from the List are thread-safe.
D. A Person object retrieved from the List is copied when written to.
E. Multiple threads can safely delete Person objects from the List.
Answer: C
QUESTION NO: 4
Given a resource bundle MessageBundle, what is the name of the default bundle file?
A. MessageBundle.profile
B. MessageBundle.xml
C. MessageBundle.java
D. MessageBundle.properties
Answer: D
QUESTION NO: 5
Which three must be used when using the Java.util.concurrent package to execute a task that
returns a result without blocking?
A. ExecutorService
B. Runnable
C. Future
D. Callable
E. Thread
F. Executor
Answer: A,D,F
QUESTION NO: 6
Which three enum constants are defined in FilevisitResult?
A. CONTINUE
B. SKIP_SIBLINGS
C. FOLLOW_LINKS
D. TERMINATE
E. NOFOLLOW_LINKS
F. DELETE_CHILD
Answer: A,B,D
QUESTION NO: 7
Which is true regarding the java.nio.file.Path Interface?
A. The interface extends WatchService interface
B. Implementations of this interface are immutable.
C. Implementations of this interface are not safe for use by multiple concurrent threads.
D. Paths associated with the default provider are not interoperable with the java.io.File class.
Answer: A
QUESTION NO: 8
The two methods of course rescue that aggregate the features located in multiple classes are
A. Inheritance
B. Copy and Paste
C. Composition
D. Refactoring
E. Virtual Method Invocation
Answer: C,E
QUESTION NO: 9
Which two statements are true?
A. Implementing a DAO often includes the use of factory.
B. To be implemented properly, factories rely on the private keyword.
C. Factories are an example of the OO principle "program to an interface."
D. Using factory prevents your replication from being tightly coupled with a specific Singleton
E. One step in implementing a factory is to add references from all the classes that the factory will
merge.
Answer: A,C
QUESTION NO: 10
The advantage of a CallableStatement over a PreparedStatement is that it:
A. Is easier to construct
B. Supports transactions
C. Runs on the database
D. Uses Java instead of native SQL
Answer: C
I hope you must have find these questions very helpful. If you want to get complete set of real exam questions and their answer please visit our FAQ's section to know more.