2026年最新の1z1-809実際問題集には試験のコツがあるPDF試験材料
心強い1z1-809のPDF問題集問題
質問 # 74
Given the content of /resourses/Message.properties:
welcome1="Good day!"
and given the code fragment:
Properties prop = new Properties ();
FileInputStream fis = new FileInputStream ("/resources/Message.properties"); prop.load(fis); System.out.println(prop.getProperty("welcome1")); System.out.println(prop.getProperty("welcome2", "Test"));//line n1 System.out.println(prop.getProperty("welcome3")); What is the result?
- A. Good day!
Test
null - B. A compilation error occurs at line n1.
- C. Good day!
Test
followed by an Exception stack trace - D. Good day!
followed by an Exception stack trace
正解:A
質問 # 75
Which statement is true about java.time.Duration?
- A. It tracks time zones.
- B. It preserves daylight saving time.
- C. It defines time-based values.
- D. It defines date-based values.
正解:C
質問 # 76
What is the proper way to defined a method that take two int values and returns their sum as an int value?
- A. int sum(int first, int second) { first + second; }
- B. sum(int first, int second) { return first + second; }
- C. int sum(int first, second) { return first + second; }
- D. int sum(int first, int second) { return first + second; }
- E. void sum (int first, int second) { return first + second; }
正解:D
質問 # 77
Given the code fragments:
class Caller implements Callable<String> {
String str;
public Caller (String s) {this.str=s;}
public String call()throws Exception { return str.concat ("Caller");}
}
class Runner implements Runnable {
String str;
public Runner (String s) {this.str=s;}
public void run () { System.out.println (str.concat ("Runner"));}
}
and
public static void main (String[] args) InterruptedException,
ExecutionException {
ExecutorService es = Executors.newFixedThreadPool(2);
Future f1 = es.submit (new Caller ("Call"));
Future f2 = es.submit (new Runner ("Run"));
String str1 = (String) f1.get();
String str2 = (String) f2.get(); //line n1
System.out.println(str1+ ":" + str2);
}
What is the result?
- A. An Executionis thrown at run time.
- B. The program prints:
Run Runner
Call Caller : null
And the program does not terminate. - C. The program terminates after printing:
Run Runner
Call Caller : Run - D. A compilation error occurs at line n1.
正解:B
質問 # 78
Given:
and
Which interface from the java.util.function package should you use to refactor the class Txt?
- A. Consumer
- B. Predicate
- C. Supplier
- D. Function
正解:D
解説:
References:
質問 # 79
Given the code fragments:
and
What is the result?
- A. A compilation error occurs.
- B. [Dog, Cat, Mouse]
- C. null
- D. DogCatMouse
正解:B
質問 # 80
Given the code fragment:
List<String> codes = Arrays.asList ("DOC", "MPEG", "JPEG");
codes.forEach (c -> System.out.print(c + " "));
String fmt = codes.stream()
.filter (s-> s.contains ("PEG"))
.reduce((s, t) -> s + t).get();
System.out.println("\n" + fmt);
What is the result?
- A. MPEGJPEGMPEGJPEG
- B. DOC MPEG MPEGJPEGMPEGMPEGJPEG
- C. DOC MPEG JPEGMPEGJPEG
- D. The order of the output is unpredictable.
正解:C
質問 # 81
Given the code fragment:
What is the result?
- A. Compilation fails.
- B. 0
- C. 1
- D. 2
正解:B
質問 # 82
Given the code fragments:
4.void doStuff() throws ArithmeticException, NumberFormatException, Exception {
5.if (Math.random() >-1 throw new Exception ("Try again");
6.} and
24.
try {
25.
doStuff ( ):
26.
} catch (ArithmeticException | NumberFormatException | Exception e) {
27.
System.out.println (e.getMessage()); }
28.
catch (Exception e) {
29.
System.out.println (e.getMessage()); }
30.
}
Which modification enables the code to print Try again?
- A. Replace line 26 with:
} catch (Exception | ArithmeticException | NumberFormatException e) { - B. Replace line 27 with:
throw e; - C. Replace line 26 with:
} catch (ArithmeticException | NumberFormatException e) { - D. Comment the lines 28, 29 and 30.
正解:C
質問 # 83
Given the code fragment:
List<String> listVal = Arrays.asList("Joe", "Paul", "Alice", "Tom");
System.out.println (
// line n1
);
Which code fragment, when inserted at line n1, enables the code to print the count of string elements whose length is greater than three?
- A. listVal.stream().filter(x -> x.length()>3).count()
- B. listVal.stream().peek(x -> x.length()>3).count().get()
- C. listVal.stream().filter(x -> x.length()>3).mapToInt(x -> x).count()
- D. listVal.stream().map(x -> x.length()>3).count()
正解:B
質問 # 84
Given the code fragment:
What is the result?
- A. A compilation error occurs because the IOException isn't declared to be thrown or caught?
- B. The code reads the password without echoing characters on the console.
- C. A compilation error occurs at line n1.
- D. A compilation error occurs at line n2.
正解:A
質問 # 85
Given the code fragment:
public class Foo {
public static void main (String [ ] args) {
Map<Integer, String> unsortMap = new HashMap< > ( );
unsortMap.put (10, "z");
unsortMap.put (5, "b");
unsortMap.put (1, "d");
unsortMap.put (7, "e");
unsortMap.put (50, "j");
Map<Integer, String> treeMap = new TreeMap <Integer, String> (new
Comparator<Integer> ( ) {
@Override public int compare (Integer o1, Integer o2) {return o2.compareTo
(o1); } } );
treeMap.putAll (unsortMap);
for (Map.Entry<Integer, String> entry : treeMap.entrySet () ) {
System.out.print (entry.getValue () + " ");
}
}
}
What is the result?
- A. d b e z j
- B. A compilation error occurs.
- C. z b d e j
- D. j z e b d
正解:D
質問 # 86
The data.doc, data.txt and data.xml files are accessible and contain text.
Given the code fragment:
Stream<Path> paths = Stream.of (Paths. get("data.doc"),
Paths. get("data.txt"),
Paths. get("data.xml"));
paths.filter(s-> s.toString().endWith("txt")).forEach(
s -> {
try {
Files.readAllLines(s)
.stream()
.forEach(System.out::println); //line n1
} catch (IOException e) {
System.out.println("Exception");
}
}
);
What is the result?
- A. The program prints the content of data.txt file.
- B. The program prints the content of the three files.
- C. A compilation error occurs at line n1.
- D. The program prints:
Exception
<<The content of the data.txt file>>
Exception
正解:A
質問 # 87
Given the code fragments:
class Caller implements Callable<String> {
String str;
public Caller (String s) {this.str=s;}
public String call()throws Exception { return str.concat ("Caller");}
}
class Runner implements Runnable {
String str;
public Runner (String s) {this.str=s;}
public void run () { System.out.println (str.concat ("Runner"));}
}
and
public static void main (String[] args) InterruptedException, ExecutionException {
ExecutorService es = Executors.newFixedThreadPool(2);
Future f1 = es.submit (new Caller ("Call"));
Future f2 = es.submit (new Runner ("Run"));
String str1 = (String) f1.get();
String str2 = (String) f2.get();//line n1
System.out.println(str1+ ":" + str2);
}
What is the result?
- A. The program prints:Run RunnerCall Caller : nullAnd the program does not terminate.
- B. A compilation error occurs at line n1.
- C. The program terminates after printing:Run RunnerCall Caller : Run
- D. An Execution is thrown at run time.
正解:A
質問 # 88
Given the code fragments:
class TechName {
String techName;
TechName (String techName) {
this.techName=techName;
}
}
and
List<TechName> tech = Arrays.asList (
new TechName("Java-"),
new TechName("Oracle DB-"),
new TechName("J2EE-")
) ;
Stream<TechName> stre = tech.stream();
/ /line n1
Which should be inserted at line n1 to print Java-Oracle DB-J2EE-?
- A. stre.forEach(System.out::print);
- B. stre.map(a-> a).forEachOrdered(System.out::print);
- C. stre.map(a-> a.techName).forEach(System.out::print);
- D. stre.forEachOrdered(System.out::print);
正解:B
質問 # 89
Given the code fragment:
public static void main (String[] args) throws IOException {
BufferedReader brCopy = null;
try (BufferedReader br = new BufferedReader (new FileReader
(“employee.txt”))) { //
line n1
br.lines().forEach(c -> System.out.println(c));
brCopy = br; //line n2
}
brCopy.ready(); //line n3;
}
Assume that the ready method of the BufferedReader, when called on a closed BufferedReader, throws an exception, and employee.txt is accessible and contains valid text.
What is the result?
- A. A compilation error occurs at line n3.
- B. The code prints the content of the employee.txtfile and throws an exception at line n3.
- C. A compilation error occurs at line n1.
- D. A compilation error occurs at line n2.
正解:B
質問 # 90
Given the code fragments:
and
What is the result?
- A. France
Not Found - B. France
Optional[NotFound] - C. Optional[France]
Not Found - D. Optional [France]
Optional [NotFound]
正解:A
質問 # 91
Given the code fragment:
public static void main (String[] args) throws IOException {
BufferedReader brCopy = null;
try (BufferedReader br = new BufferedReader (new FileReader("employee.txt"))) { //
line n1
br.lines().forEach(c -> System.out.println(c));
brCopy = br;//line n2
}
brCopy.ready(); //line n3;
}
Assume that the ready method of the BufferedReader, when called on a closed BufferedReader, throws an exception, and employee.txt is accessible and contains valid text.
What is the result?
- A. The code prints the content of the employee.txt file and throws an exception at line n3.
- B. A compilation error occurs at line n1.
- C. A compilation error occurs at line n3.
- D. A compilation error occurs at line n2.
正解:B
質問 # 92
Which two statements are true about synchronization and locks? (Choose two.)
- A. The intrinsic lock will be retained by a thread if return from a synchronized method is caused by an
uncaught exception. - B. A thread automatically acquires the intrinsic lock on a synchronized method's object when entering that
method. - C. A thread automatically acquires the intrinsic lock on a synchronized statement when executed.
- D. A thread exclusively owns the intrinsic lock of an object between the time it acquires the lock and the
time it releases it. - E. Threads cannot acquire intrinsic locks on classes.
正解:A、C
質問 # 93
Given the code fragment:
List<String> codes = Arrays.asList ("DOC", "MPEG", "JPEG");
codes.forEach (c -> System.out.print(c + " "));
String fmt = codes.stream()
. filter (s-> s.contains ("PEG"))
. reduce((s, t) -> s + t).get();
System.out.println("\n" + fmt);
What is the result?
- A. DOC MPEG JPEG
MPEGJPEG - B. MPEGJPEG
MPEGJPEG - C. DOC MPEG MPEGJPEG
MPEGMPEGJPEG - D. The order of the output is unpredictable.
正解:A
質問 # 94
Given:
and the code fragment:
What is the result?
- A. false
true - B. true
false - C. false
false - D. true
true
正解:B
質問 # 95
Given the code fragment:
What is the result?
- A. 0
- B. 1
- C. A compilation error occurs at line n1.
- D. A compilation error occurs at line n2.
正解:D
質問 # 96
Assume customers.txtis accessible and contains multiple lines.
Which code fragment prints the contents of the customers.txtfile?
Stream<String> stream = Files.find (Paths.get (“customers.txt”));
- A. stream.forEach( c) -> System.out.println(c));
Stream<String> lines = Files.lines (Paths.get (“customers.txt”)); - B. lines.forEach( c) -> System.out.println(c));
- C. stream.forEach((String c) -> System.out.println(c));
Stream<Path> stream = Files.find (Paths.get (“customers.txt”)); - D. stream.forEach( c) -> System.out.println(c));
Stream<Path> stream = Files.list (Paths.get (“customers.txt”));
正解:C
質問 # 97
Given the content of /resourses/Message.properties:
welcome1="Good day!"
and given the code fragment:
Properties prop = new Properties ();
FileInputStream fis = new FileInputStream ("/resources/Message.properties"); prop.load(fis); System.out.println(prop.getProperty("welcome1")); System.out.println(prop.getProperty("welcome2", "Test"));//line n1 System.out.println(prop.getProperty("welcome3")); What is the result?
Good day!
- A. Test
followed by an Exceptionstack trace
Good day! - B. Test
null - C. A compilation error occurs at line n1.
- D. followed by an Exceptionstack trace
Good day!
正解:B
質問 # 98
The data.doc, data.txt and data.xml files are accessible and contain text.
Given the code fragment:
Stream<Path> paths = Stream.of (Paths. get("data.doc"),
Paths. get("data.txt"),
Paths. get("data.xml"));
paths.filter(s-> s.toString().endWith("txt")).forEach(
s -> {
try {
Files.readAllLines(s)
.stream()
.forEach(System.out::println); //line n1
} catch (IOException e) {
System.out.println("Exception");
}
}
);
What is the result?
- A. The program prints the content of the three files.
- B. The program prints the content of data.txt file.
- C. A compilation error occurs at line n1.
- D. The program prints:
Exception
<<The content of the data.txt file>>
Exception
正解:A
質問 # 99
......
結果を保証するには2026年01月最新の無料版提供しています:https://www.goshiken.com/Oracle/1z1-809-mondaishu.html
正真正銘の1z1-809問題集で無料PDF問題で合格させる:https://drive.google.com/open?id=1WF4nR80c6xpsX4r-7Y6LKALDM2eG6i1j