Given the code fragment:
String s = "Java 7, Java 6";
Pattern p = Pattern.compile("Java.+\\d");
Matcher m = p.matcher(s);
while (m.find()) {
System.out.println(m.group());
}
What is the result?
A. Java 7Given the code fragment:
1.
Thread t1 = new Thread ();
2.
t1.start ()
3.
t1.join ( );
4.
// . . .
Which three are true?
A. On line 3, the current thread stops and waits until the t1 thread finishes.Given:
interface Rideable {
String ride() ;
}
class Horse implements Rideable {
String ride() { return "cantering "; }
}
class Icelandic extends Horse {
String ride() { return "tolting "; }
}
class Test {
public static void main(String[] args) {
Rideable r1 = new Icelandic();
Rideable r2 = new Horse();
Horse h1 = new Icelandic();
System.out.println(r1.ride() + r2.ride() + h1.ride());
}
}
What is the result?
A. tolting cantering canteringGiven that myFile.txt contains:
First
Second
Third
And given:
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class ReadFile04 {
public static void main(String[] args) {
try (BufferedReader buffIn =
new BufferedReader(new FileReader("D:\\faculty\\myfile.txt"))) {
String line = "";
int count = 1;
buffIn.mark(1);
line = buffIn.readLine();
System.out.println(count + ": " + line);
line = buffIn.readLine();
count++;
System.out.println(count + ": " + line);
buffIn.reset();
line = buffIn.readLine();
count++;
System.out.println(count + ": " + line);
} catch (IOException e) {
System.out.println("IOException");
}
}
}
What is the result?
A. 1: First 2: Second 3: ThirdGiven:

What is the result?
A. John Adams George Washington Thomas JeffersonFor which three objects must a vendor provide implementations in its JDBC driver?
A. TimeGiven the code fragment:
try {
String query = "SELECT * FROM Employee WHERE ID=110";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query);
System.out.println("Employee ID: " + rs.getInt("ID"));
} catch (Exception se) {
System.out.println("Error");
}
Assume that the SQL query matches one record. What is the result of compiling and executing this code?
A. The code prints Error.Given:
import java.io.File;
import java.nio.file.Path;
public class Test12 {
static String displayDetails(String path, int location) {
Path p = new File(path).toPath();
String name = p.getName(location).toString();
return name;
}
public static void main(String[] args) {
String path = "project//doc//index.html";
String result = displayDetails(path,2);
System.out.print(result);
}
}
What is the result?
A. docWhat are two differences between Callable and Runnable?
A. A callable can return a value when executing, but a Runnable cannot.Given:
public class StringSplit01 {
public static void main(String[] args) {
String names = "John-.-George-.-Paul-.-Ringo";
String[] results = names.split("-. .");
for(String str:results) {
System.out.println(str);
}
}
}
What is the result?
A. John?. -George-. ?Paul -. ?RingoNowadays, 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.