1Z0-805: Upgrade to Java SE Programmer Dumps: Real Exam Questions





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.

1Z0-804: Java SE Programmer II Dumps: Real Exam Questions




QUESTION NO: 1
Which two forms of abstraction can a programmer use in Java?
A. enums
B. interfaces
C. primitives
D. abstract classes
E. concrete classes
F. primitive wrappers
Answer: B,D

QUESTION NO: 2
Which four are true about enums?
A. An enum is typesafe.
B. An enum cannot have public methods or fields.
C. An enum can declare a private constructor.
D. All enums implicitly implement Comparable.
E. An enum can subclass another enum.
F. An enum can implement an interface.
Answer: A,C,D,F

QUESTION NO: 3
Which two compile?
A. interface Compilable {
void compile();
}
B. interface Compilable {
final void compile();
}
C. interface Compilable {
static void compile();
}
D. interface Compilable {
abstract void compile();
}
E. interface Compilable {
protected abstract void compile ();
}
Answer: A,D

QUESTION NO: 4
Which is a key aspect of composition?
A. Using inheritance
B. Method delegation
C. Creating abstract classes
D. Implementing the composite interface
Answer: B

QUESTION NO: 5
Which two properly implement a Singleton pattern?
A. class Singleton {
private static Singleton instance;
private Singleton () {}
public static synchronized Singleton getInstance() {
if (instance == null) {
instance = new Singleton ();
}
return instance;
}
}
B. class Singleton {
private static Singleton instance = new Singleton();
protected Singleton () {}
public static Singleton getInstance () {
return instance;
}
}
C. class Singleton {
Singleton () {}
private static class SingletonHolder {
private static final Singleton INSTANCE = new Singleton ();
}
public static Singleton getInstance () {
return SingletonHolder.INSTANCE;
}
}
D. enum Singleton {
INSTANCE;
}
Answer: A,D

QUESTION NO: 6
Which statement declares a generic class?
A. public class Example < T > { }
B. public class <Example> { }
C. public class Example <> { }
D. public class Example (Generic) { }
E. public class Example (G) { }
F. public class Example { }
Answer: A

QUESTION NO: 7
Which code fragment correctly appends "Java 7" to the end of the file /tmp/msg.txt?
A. FileWriter w = new FileWriter("/tmp/msg.txt");
append("Java 7");
close();
B. FileWriter w = new FileWriter("/tmp/msg.txt", true);
append("Java 7");
close();
C. FileWriter w = new FileWriter("/tmp/msg.txt", FileWriter.MODE_APPEND);
append("Java 7");
close();
D. FileWriter w = new FileWriter("/tmp/msg.txt", Writer.MODE_APPEND);
append("Java 7");
close();
Answer: B

QUESTION NO: 8
An application is waiting for notification of changes to a tmp directory using the following code
statements:
Path dir = Paths.get("tmp")
WatchKey key = dir.register (watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY) ;
In the tmp directory, the user renames the file testA to testB,
Which statement is true?
A. The events received and the order of events are consistent across all platforms.
B. The events received and the order of events are consistent across all Microsoft Windows
versions.
C. The events received and the order of events are consistent across all UNIX platforms.
D. The events received and the order of events are platform dependent.
Answer: A

QUESTION NO: 9
Which two statements are true about RowSet subinterfaces?
A. A JdbcRowSet object provides a JavaBean view of a result set.
B. A CachedRowSet provides a connected view of the database.
C. A FilteredRowSet object filter can be modified at any time.
D. A WebRowSet returns JSON-formatted data.
Answer: A,C

QUESTION NO: 10
Which two demonstrate the valid usage of the keyword synchronized?
A. interface ThreadSafe {
synchronized void doIt();
}
B. abstract class ThreadSafe {
synchronized abstract void doIt();
}
C. class ThreadSafe {
synchronized static void soIt () {}
}
D. enum ThreadSafe {
ONE, TWO, Three;
synchronized final void doIt () {}
}
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.