Oracle Java SE 21 Developer Professional Sample Questions:
1. Which of the following methods of java.util.function.Predicate aredefault methods?
A) isEqual(Object targetRef)
B) or(Predicate<? super T> other)
C) test(T t)
D) not(Predicate<? super T> target)
E) and(Predicate<? super T> other)
F) negate()
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?
A) oos.writeObject("Today");
B) fos.write("Today");
C) oos.write("Today");
D) fos.writeObject("Today");
3. Given:
java
interface A {
default void ma() {
}
}
interface B extends A {
static void mb() {
}
}
interface C extends B {
void ma();
void mc();
}
interface D extends C {
void md();
}
interface E extends D {
default void ma() {
}
default void mb() {
}
default void mc() {
}
}
Which interface can be the target of a lambda expression?
A) None of the above
B) D
C) E
D) B
E) A
F) C
4. Given:
java
var array1 = new String[]{ "foo", "bar", "buz" };
var array2[] = { "foo", "bar", "buz" };
var array3 = new String[3] { "foo", "bar", "buz" };
var array4 = { "foo", "bar", "buz" };
String array5[] = new String[]{ "foo", "bar", "buz" };
Which arrays compile? (Select 2)
A) array1
B) array2
C) array4
D) array5
E) array3
5. Given:
java
interface Calculable {
long calculate(int i);
}
public class Test {
public static void main(String[] args) {
Calculable c1 = i -> i + 1; // Line 1
Calculable c2 = i -> Long.valueOf(i); // Line 2
Calculable c3 = i -> { throw new ArithmeticException(); }; // Line 3
}
}
Which lines fail to compile?
A) Line 3 only
B) Line 1 only
C) Line 1 and line 3
D) The program successfully compiles
E) Line 2 and line 3
F) Line 2 only
G) Line 1 and line 2
Solutions:
Question # 1 Answer: B,E,F | Question # 2 Answer: A | Question # 3 Answer: A | Question # 4 Answer: A,D | Question # 5 Answer: D |
Frequently Asked Questions
1. What kinds of study material ITBraindumps provides?
Test engine: study test engine can be downloaded and run on your own devices. Practice the test on the interactive & simulated environment.
PDF (duplicate of the test engine): the contents are the same as the test engine, support printing.
2. How long can I get the products after purchase?
You will receive an email attached with the 1z1-830 study material within 5-10 minutes, and then you can instantly download it for study. If you do not get the study material after purchase, please contact us with email immediately.
3. Can I get the updated products and how to get?
Yes, you will enjoy one year free update after purchase. If there is any update, our system will automatically send the updated study material to your payment email.
4. What's the applicable operating system of the test engine?
Online test engine can supports Windows / Mac / Android / iOS, etc., because it is the software based on WEB browser. You can use it on any electronic device and practice with self-paced.
Online test engine supports offline practice, while the precondition is that you should run it with the internet at the first time.
PC test engine is suitable for windows operating system, running on the Java environment, and can install on multiple computers.
PDF version: can be read under the Adobe reader, or many other free readers, including OpenOffice, Foxit Reader and Google Docs
5. How does your testing engine works?
Once download and installed on your PC, you can practice test questions, review your 1z1-830 questions & answers using two different options 'practice exam' and 'virtual exam'.
Virtual Exam - test yourself with 1z1-830 exam questions with a time limit.
Practice exam - review 1z1-830 exam questions one by one, see correct answers.
6. How often do you release your products updates?
All the products are updated frequently but not on a fixed date. Our professional team pays a great attention to the exam updates and they always upgrade the content accordingly.
7. Do you have any discounts?
We offer some discounts to our customers. There is no limit to some special discount. You can check regularly of our site to get the coupons.