リアルOracle 1z1-819試験問題 [更新されたのは2022年]
1z1-819試験問題集で合格させるのは更新されたのは2022年年最新のJava SE 11 Developer
Oracle 1z1-819 認定試験の出題範囲:
トピック | 出題範囲 |
---|---|
トピック 1 |
|
トピック 2 |
|
トピック 3 |
|
トピック 4 |
|
トピック 5 |
|
トピック 6 |
|
トピック 7 |
|
質問 67
Given:
LocalDate d1 = LocalDate.of(1997,2,7);
DateTimeFormatter dtf =
DateTimeFormatter.ofPattern( /*insert code here*/ );
System.out.println(dtf.format (d1));
Which pattern formats the date as Friday 7th of February 1997?
- A. "eeee dd+"th of"+ MMM yyyy"
- B. "eeee d+"th of"+ MMMM yyyy"
- C. "eeee dd'th of' MMM yyyy"
- D. "eeee d'th of' MMMM yyyy"
正解: C
質問 68
Given
:
What is the correct definition of the JsonField annotation that makes the Point class compile?
A)
B)
C)
- A. Option B
- B. Option C
- C. Option A
正解: C
質問 69
Given:
Which code, when inserted at one or more marked positions, would allow classes B and C to compile?
- A. @Override // position 3void x () {} // position 3@Override // position 3public void z() { } // position 3
- B. @Override // position 2public void z() { } // position 3
- C. public void z() { } // position 3
- D. implements A // position 1@Override // position 2
正解: B
質問 70
Given:
and
What is the result?
- A. A NullPointerException is thrown at run time.
- B. A ClassCastException is thrown at run time.
- C. 1
Null
null - D. 1
1
1 - E. The compilation fails.
正解: E
解説:
質問 71
Given the code fragment:
You must make the countvariable thread safe.
Which two modifications meet your requirement? (Choose two.)
- A. replace line 2 with public static synchronized void main(String[] args) {
- B. replace line 1 with private AtomicInteger count = new AtomicInteger(0);and replace line 3 with test.count.incrementAndGet();
- C. replace line 3 with
synchronized(test) {
test.count++;
} - D. replace line 1 with private volatile int count = 0;
- E. replace line 3 with
synchronized(test.count) {
test.count++;
}
正解: B,E
解説:
Explanation/Reference: https://stackoverflow.com/questions/15852123/java-thread-safe-counter/15852164
質問 72
Given:
Which two statements are true if the method is added to Bar? (Choose two.)
- A. public <T> Iterable<T> foo(Collection<T> arg) { ... } overrides Foo.foo.
- B. public Collection<String> foo(Collection<String> arg) { ... } overrides Foo.foo.
- C. public <T> Collection<T> foo(Collection<T> arg) { ... } overloads Foo.foo.
- D. public <T> Collection<T> bar(Collection<T> arg) { ... } overloads Foo.foo.
- E. public <T> Collection<T> foo(Stream<T> arg) { ... } overloads Foo.foo.
- F. public <T> List<T> foo(Collection<T> arg) { ... } overrides Foo.foo.
正解: A,F
質問 73
Which two statements are correct about modules in Java? (Choose two.)
- A. java.base exports all of the Java platforms core packages.
- B. module-info.java cannot be empty.
- C. A module must be declared in module-info.java file.
- D. By default, modules can access each other as long as they run in the same folder.
- E. module-info.java can be placed in any folder inside module-path.
正解: A,C
質問 74
Given:
What is the output?
- A. A runtime error is thrown.
- B. Message from Abstract Copier: Attempt00
- C. A compilation error is thrown.
- D. Message from Copier: Attempt00
正解: C
質問 75
Which module-info.java is correct for a service provider for a print service defined in the PrintServiceAPI module?
module PrintServiceProvider {
- A. requires PrintServiceAPI;
provides org.printservice.spi.Print with
com.provider.PrintService;
}
module PrintServiceProvider { - B. requires PrintServiceAPI;
exports org.printservice.spi.Print with
com.provider.PrintService;
} - C. requires PrintServiceAPI;
uses com.provider.PrintService;
}
module PrintServiceProvider { - D. requires PrintServiceAPI;
exports org.printservice.spi;
}
module PrintServiceProvider {
正解: D
質問 76
Given:
Which two lines can replace line 1 so that the Y class compiles? (Choose two.)
- A. set(map.values());
- B. set(map)
- C. map.forEach((k, v) -> set(v)));
- D. super.set(List<String> map)
- E. super.set(map.values());
正解: A,E
質問 77
Given:
What is the output?
banana orange apple lemon
- A. -----
apple banana lemon orange
-----
----- - B. banana orange apple lemon
-----
apple banana lemon orange
----- - C. -----
----- - D. -----
----- - E. -----
banana orange apple lemon apple banana lemon orange
banana orange apple lemon apple banana lemon orange
正解: E
解説:
質問 78
Which is a proper JDBC URL?
- A. jdbe.mysql.com://localhost:3306/database
- B. jdbc:mysql://localhost:3306/database
- C. http://localhost.mysql.com:3306/database
- D. http://localhost mysql.jdbc:3306/database
正解: B
質問 79
Given:
Which three are correct? (Choose three.)
- A. f1.foo(li) prints Bonjour le monde!
- B. f1.foo(li) prints Hola Mundo!
- C. f2.foo(li) prints Hola Mundo!
- D. f2.foo(li) prints Hello world!
- E. b1.foo(li) prints Bonjour le monde!
- F. b1.foo(li) prints Hello world!
- G. f2.foo(li) prints Bonjour le monde!
- H. b1.foo(li) prints Hola Mundo!
- I. f1.foo(li) prints Hello world!
正解: A,F,H
質問 80
var numbers = List.of(0,1,2,3,4,5,6,7,8,9);
You want to calculate the average of numbers. Which two codes will accomplish this? (Choose two.)
- A. double avg = numbers.stream().average().getAsDouble();
- B. double avg = numbers.stream().mapToInt (i -> i).average().parallel();
- C. double avg = numbers.parallelStream().mapToInt (m -> m).average().getAsDouble ();
- D. double avg = numbers.stream().collect(Collectors.averagingDouble(n -> n));
- E. double avg = numbers.stream().parallel().averagingDouble(a -> a);
正解: A,C
解説:
質問 81
Given the code fragment:
Which action enables Computatorclass to compile?
- A. change Line 5 to List<Double> numbers = List.of(5, 4, 6, 3, 7, 2, 8, 1, 9);
- B. change Line 1 to add throws NumberFormatException
- C. change Line 4 to for (Double n : collection) {
- D. change Line 2 to public Double sum ( C collection) {
- E. change Line 3 to Double sum = 0.0;
正解: D
質問 82
Given:
What is the result?
- A. b3
- B. 0
- C. b1
- D. 1
- E. b2
- F. The compilation fails due to an error in line 1.
- G. 2
正解: B
解説:
質問 83
Given:
What is the type of the local variable x?
- A. Character
- B. String[ ]
- C. char
- D. String
正解: D
質問 84
Given:
What is the result?
- A. 0
- B. 1
- C. 2
- D. 3
正解: B
質問 85
Given an application with a main module that has this module-info.java file:
Which two are true? (Choose two.)
- A. To compile without an error, the application must have at least one module in the module source path that provides an implementation of country.CountryDetails.
- B. A module providing an implementation of country.CountryDetails must have a requires main; directive in its module-info.java file.
- C. A module providing an implementation of country.CountryDetails can be compiled and added without recompiling the main module.
- D. To run without an error, the application must have at least one module in the module path that provides an implementation of country.CountryDetails.
- E. An implementation of country.countryDetails can be added to the main module.
正解: A,B
解説:
Reference:
/java-9-error-not-in-a-module-on-the-module-source- path
質問 86
Given:
and:
Which code, when inserted on line 10, prints the number of unique localities from the roster list?
- A. .map(Employee::getLocality)
.distinct()
.count(); - B. .map(e > e.getLocality())
.collect(Collectors.toSet())
.count(); - C. map(e > e.getLocality())
.count(); - D. .filter(Employee::getLocality)
.distinct()
.count();
正解: D
質問 87
Given:
Which loop incurs a compile time error?
- A. the loop starting line 7
- B. the loop starting line 3
- C. the loop starting line 11
- D. the loop starting line 14
正解: D
質問 88
Given the code fragment:
What is the result?
- A. true false false
- B. false false true
- C. false true false
- D. false true true
正解: C
解説:
質問 89
Given:
Which two statements can be added at line 1 in Bar to successfully compile it? (Choose two.)
- A. public List<Integer> foo(Set<CharSequence> m) { ... }
- B. public List<Integer> foo(TreeSet<String> m) { ... }
- C. public List<Object> foo(Set<CharSequence> m) { ... }
- D. public ArrayList<Integer> foo(Set<String> m) { ... }
- E. public ArrayList<Number> foo(Set<CharSequence> m) { ... }
- F. public List<Integer> foo(Set<String> m) { ... }
正解: B,E
質問 90
......
1z1-819試験問題集、1z1-819練習テスト問題:https://www.jpntest.com/shiken/1z1-819-mondaishu