1z1-830 試験問題を無料オンラインアクセス
試験コード: | 1z1-830 |
試験名称: | Java SE 21 Developer Professional |
認定資格: | Oracle |
無料問題数: | 85 |
更新日: | 2025-09-20 |
Given:
java
void verifyNotNull(Object input) {
boolean enabled = false;
assert enabled = true;
assert enabled;
System.out.println(input.toString());
assert input != null;
}
When does the given method throw a NullPointerException?
Given:
java
Period p = Period.between(
LocalDate.of(2023, Month.MAY, 4),
LocalDate.of(2024, Month.MAY, 4));
System.out.println(p);
Duration d = Duration.between(
LocalDate.of(2023, Month.MAY, 4),
LocalDate.of(2024, Month.MAY, 4));
System.out.println(d);
What is the output?
Given:
java
String textBlock = """
j \
a \t
v \s
a \
""";
System.out.println(textBlock.length());
What is the output?
Given:
java
try (FileOutputStream fos = new FileOutputStream("t.tmp");
ObjectOutputStream oos = new ObjectOutputStream(fos)) {
fos.write("Today");
fos.writeObject("Today");
oos.write("Today");
oos.writeObject("Today");
} catch (Exception ex) {
// handle exception
}
Which statement compiles?