| Exam Code/Number: | 1Z1-805Join the discussion |
| Exam Name: | Upgrade to Java SE 7 Programmer |
| Certification: | Oracle |
| Question Number: | 90 |
| Publish Date: | Jul 13, 2026 |
|
Rating
100%
|
|
Given the code fragment:
11.
public static getFileSize () throws IOException {
12.
path file = paths.get ("ex.txt");
13.
//insert code here
14.
System.out.println ("size: " + attr.size());
15.
}
public static getFileSize () throws IOException {
Path file = Paths.get ("ex.txt");
//insert code here Line **
System.out.println ("size: " + attr.size());
}
Which two fragments, when inserted independently at line **, enable printing of the file size?
What statement is true about thread starvation?
Given the code fragment:
List<Person> pList = new CopyOnWriteArrayList<Person>();
Which statement is true?
Which method or methods should you implement to create your own implementation of the java.nio.file.PathMatcher interface?
Given the code fragment:
try {
String query = "SELECT * FROM Employee WHERE ID=110";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query); // Line 13
System.out.println("Employee ID: " + rs.getInt("ID")); // Line 14
} 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?