Weekend Sale 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: sale65best

Free Oracle 1z0-830 Practice Exam with Questions & Answers

Questions 1

Given:

java

var counter = 0;

do {

System.out.print(counter + " ");

} while (++counter < 3);

What is printed?

Options:
A.

0 1 2 3

B.

0 1 2

C.

1 2 3 4

D.

1 2 3

E.

An exception is thrown.

F.

Compilation fails.

Oracle 1z0-830 Premium Access
Questions 2

Given:

java

List abc = List.of("a", "b", "c");

abc.stream()

.forEach(x -> {

x = x.toUpperCase();

});

abc.stream()

.forEach(System.out::print);

What is the output?

Options:
A.

abc

B.

An exception is thrown.

C.

Compilation fails.

D.

ABC

Questions 3

Given:

java

List 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?

Options:
A.

Numbers from 1 to 25 sequentially

B.

Numbers from 1 to 25 randomly

C.

Numbers from 1 to 1945 randomly

D.

An exception is thrown at runtime

E.

Compilation fails

Questions 4

Which StringBuilder variable fails to compile?

java

public class StringBuilderInstantiations {

public static void main(String[] args) {

var stringBuilder1 = new StringBuilder();

var stringBuilder2 = new StringBuilder(10);

var stringBuilder3 = new StringBuilder("Java");

var stringBuilder4 = new StringBuilder(new char[]{'J', 'a', 'v', 'a'});

}

}

Options:
A.

None of them

B.

stringBuilder4

C.

stringBuilder1

D.

stringBuilder3

E.

stringBuilder2

Questions 5

Given:

java

Stream strings = Stream.of("United", "States");

BinaryOperator operator = (s1, s2) -> s1.concat(s2.toUpperCase());

String result = strings.reduce("-", operator);

System.out.println(result);

What is the output of this code fragment?

Options:
A.

United-States

B.

United-STATES

C.

UNITED-STATES

D.

-UnitedStates

E.

-UNITEDSTATES

F.

-UnitedSTATES

G.

UnitedStates

Questions 6

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?

Options:
A.

None of the above

B.

C

C.

A

D.

E

E.

B

F.

D

Questions 7

Given:

java

LocalDate localDate = LocalDate.of(2020, 8, 8);

Date date = java.sql.Date.valueOf(localDate);

DateFormat formatter = new SimpleDateFormat(/* pattern */);

String output = formatter.format(date);

System.out.println(output);

It's known that the given code prints out "August 08".

Which of the following should be inserted as the pattern?

Options:
A.

MM d

B.

MM dd

C.

MMMM dd

D.

MMM dd

Questions 8

Given:

java

package vehicule.parent;

public class Car {

protected String brand = "Peugeot";

}

and

java

package vehicule.child;

import vehicule.parent.Car;

public class MiniVan extends Car {

public static void main(String[] args) {

Car car = new Car();

car.brand = "Peugeot 807";

System.out.println(car.brand);

}

}

What is printed?

Options:
A.

Peugeot

B.

Peugeot 807

C.

An exception is thrown at runtime.

D.

Compilation fails.

Questions 9

Which of the following suggestions compile?(Choose two.)

Options:
A.

java

sealed class Figure permits Rectangle {}

final class Rectangle extends Figure {

float length, width;

}

B.

java

sealed class Figure permits Rectangle {}

public class Rectangle extends Figure {

float length, width;

}

C.

java

public sealed class Figure

permits Circle, Rectangle {}

final sealed class Circle extends Figure {

float radius;

}

non-sealed class Rectangle extends Figure {

float length, width;

}

D.

java

public sealed class Figure

permits Circle, Rectangle {}

final class Circle extends Figure {

float radius;

}

non-sealed class Rectangle extends Figure {

float length, width;

}

Questions 10

Given:

java

Deque deque = new ArrayDeque<>();

deque.offer(1);

deque.offer(2);

var i1 = deque.peek();

var i2 = deque.poll();

var i3 = deque.peek();

System.out.println(i1 + " " + i2 + " " + i3);

What is the output of the given code fragment?

Options:
A.

1 2 1

B.

An exception is thrown.

C.

2 2 1

D.

2 1 2

E.

1 2 2

F.

1 1 2

G.

2 1 1

Exam Code: 1z0-830
Certification Provider: Oracle
Exam Name: Java SE 21 Developer Professional
Last Update: Jul 13, 2025
Questions: 84
PDF + Testing Engine
$164.99
$57.75
Testing Engine
$124.99
$43.75
PDF (Q&A)
$104.99
$36.75