Welcome to TestSimulate

Pass Your Next Certification Exam Fast!

Everything you need to prepare, learn & pass your certification exam easily.

365 days free updates. First attempt guaranteed success.

Oracle Java SE 21 Developer Professional (1z1-830) Free Practice Test

Question 1
Which of the followingisn'ta correct way to write a string to a file?

Correct Answer: F
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 2
Given:
java
var counter = 0;
do {
System.out.print(counter + " ");
} while (++counter < 3);
What is printed?

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 3
Given:
java
interface SmartPhone {
boolean ring();
}
class Iphone15 implements SmartPhone {
boolean isRinging;
boolean ring() {
isRinging = !isRinging;
return isRinging;
}
}
Choose the right statement.

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 4
Given:
java
DoubleSummaryStatistics stats1 = new DoubleSummaryStatistics();
stats1.accept(4.5);
stats1.accept(6.0);
DoubleSummaryStatistics stats2 = new DoubleSummaryStatistics();
stats2.accept(3.0);
stats2.accept(8.5);
stats1.combine(stats2);
System.out.println("Sum: " + stats1.getSum() + ", Max: " + stats1.getMax() + ", Avg: " + stats1.getAverage()); What is printed?

Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 5
You are working on a module named perfumery.shop that depends on another module named perfumery.
provider.
The perfumery.shop module should also make its package perfumery.shop.eaudeparfum available to other modules.
Which of the following is the correct file to declare the perfumery.shop module?

Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 6
Which methods compile?

Correct Answer: C,D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 7
Given:
java
String s = " ";
System.out.print("[" + s.strip());
s = " hello ";
System.out.print("," + s.strip());
s = "h i ";
System.out.print("," + s.strip() + "]");
What is printed?

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 8
Given:
java
public class OuterClass {
String outerField = "Outer field";
class InnerClass {
void accessMembers() {
System.out.println(outerField);
}
}
public static void main(String[] args) {
System.out.println("Inner class:");
System.out.println("------------");
OuterClass outerObject = new OuterClass();
InnerClass innerObject = new InnerClass(); // n1
innerObject.accessMembers(); // n2
}
}
What is printed?

Correct Answer: C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 9
Given:
java
List<Long> cannesFestivalfeatureFilms = LongStream.range(1, 1945)
.boxed()
.toList();
try (var executor = Executors.newVirtualThreadPerTaskExecutor()) {
cannesFestivalfeatureFilms.stream()
.limit(25)
.forEach(film -> executor.submit(() -> {
System.out.println(film);
}));
}
What is printed?

Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).