Given:
ConcurrentMap
Which fragment puts a key/value pair in partList without the responsibility of overwriting an existing key?
A. partList.out(key, "Blue Shirt");Which two actions can be used in registering a JDBC 3.0 driver?
A. Add the driver class to the META-INF/services folder of the JAR file.Given:
public class Test {
public static void main(String[] args) {
String[] arr = {"SE","ee","ME"};
for(String var : arr) {
try {
switch(var) {
case "SE":
System.out.println("Standard Edition");
break;
case "EE":
System.out.println("Enterprise Edition");
break;
default: assert false;
}
} catch (Exception e) {
System.out.println(e.getClass()); }
}
}
}
And the commands:
javac Test.java
java -ea Test
What is the result?
A. Compilation failsView the exhibit: (*Missing*)
Given the code fragment:
class Finder extends SimpleFileVisitor
private final PathMatcher matcher;
private static int numMatches = 0;
Finder () {
matcher = FileSystems.getDefault().getPathMatcher("glob:*java");
}
void find(Path file) {
Path name = file.getFileName();
if (name != null andand matcher.matches(name)) {
numMatches++;
}
}
void report()
{
System.out.println("Matched: " + numMatches);
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
find(file);
return CONTINUE;
}
}
public class Visitor {
public static void main(String[] args) throws IOException {
Finder finder = new Finder();
Files.walkFileTree(Paths.get("D:\\Project"), finder);
finder.report();
}
}
What is the result?
A. Compilation failsGiven:
public class Dog {
protected String bark() {return "woof "; }
}
public class Beagle extends Dog {
private String bark() { return "arf "; }
}
public class TestDog {
public static void main(String[] args) {
Dog[] dogs = {new Dog(), new Beagle()};
for(Dog d: dogs)
System.out.print(d.bark());
}
}
What is the result?
A. woof arfGiven:
Deque
myDeque.push("one");
myDeque.push("two");
myDeque.push("three");
System.out.println(myDeque.pop());
What is the result?
A. ThreeGiven:

What two changes should you make to apply the DAO pattern to this class?
A. Make the Customer class abstract.Given the class?
public class Name implements Comparable
String first, last;
public Name(String first, String last) {
this.first = first;
this.last = last;
}
public int compareTo (Name n) {
int cmpLast = last.compareTo(n.last);
return cmpLast != 0 ? cmpLast : first.compareTo(n.first);
}
public String toString() {
return first + " " + last;
}
}
and the code fragment:
ArrayList
list.add (new Name("Joe","Shmoe"));
list.add (new Name("John","Doe"));
list.add (new Name("Jane","Doe"));
Collections.sort(list);
for (Name n : list) {
System.out.println(n);
}
What is the result?
A. Jane Doe John Doe Joe ShmoeGiven:
public class Runner {
public static String name = "unknown";
public void start() {
System.out.println(name);
}
public static void main(String[] args) {
name = "Daniel";
start();
}
}
What is the result?
A. DanielWhich code fragment is required to load a JDBC 3.0 driver?
A. DriverManager.loadDr iver ("org.xyzdata.jdbc.NetworkDriver");Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Oracle exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 1Z0-804 exam preparations and Oracle certification application, do not hesitate to visit our Vcedump.com to find your solutions here.