Exam Name: | Java SE 21 Developer Professional | ||
Exam Code: | 1z0-830 Dumps | ||
Vendor: | Oracle | Certification: | Java SE |
Questions: | 84 Q&A's | Shared By: | tomas |
Given:
java
record WithInstanceField(String foo, int bar) {
double fuz;
}
record WithStaticField(String foo, int bar) {
static double wiz;
}
record ExtendingClass(String foo) extends Exception {}
record ImplementingInterface(String foo) implements Cloneable {}
Which records compile? (Select 2)
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?
Given:
java
DoubleStream doubleStream = DoubleStream.of(3.3, 4, 5.25, 6.66);
Predicate
System.out.println(doubleStream.anyMatch(doublePredicate));
What is printed?