Summer Sale Special 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ex2p65

Exact2Pass Menu

Java SE 21 Developer Professional

Last Update 19 hours ago Total Questions : 84

The Java SE 21 Developer Professional content is now fully updated, with all current exam questions added 19 hours ago. Deciding to include 1z0-830 practice exam questions in your study plan goes far beyond basic test preparation.

You'll find that our 1z0-830 exam questions frequently feature detailed scenarios and practical problem-solving exercises that directly mirror industry challenges. Engaging with these 1z0-830 sample sets allows you to effectively manage your time and pace yourself, giving you the ability to finish any Java SE 21 Developer Professional practice test comfortably within the allotted time.

Question # 4

Given:

java

final Stream strings =

Files.readAllLines(Paths.get("orders.csv"));

strings.skip(1)

.limit(2)

.forEach(System.out::println);

And that the orders.csv file contains:

mathematica

OrderID,Customer,Product,Quantity,Price

1,Kylian Mbappé,Keyboard,2,25.50

2,Teddy Riner,Mouse,1,15.99

3,Sebastien Loeb,Monitor,1,199.99

4,Antoine Griezmann,Headset,3,45.00

What is printed?

A.

arduino

1,Kylian Mbappé,Keyboard,2,25.50

2,Teddy Riner,Mouse,1,15.99

3,Sebastien Loeb,Monitor,1,199.99

4,Antoine Griezmann,Headset,3,45.00

B.

arduino

1,Kylian Mbappé,Keyboard,2,25.50

2,Teddy Riner,Mouse,1,15.99

C.

arduino

2,Teddy Riner,Mouse,1,15.99

3,Sebastien Loeb,Monitor,1,199.99

D.

An exception is thrown at runtime.

E.

Compilation fails.

Question # 5

Given:

java

var hauteCouture = new String[]{ "Chanel", "Dior", "Louis Vuitton" };

var i = 0;

do {

System.out.print(hauteCouture[i] + " ");

} while (i++ > 0);

What is printed?

A.

Chanel

B.

Chanel Dior Louis Vuitton

C.

An ArrayIndexOutOfBoundsException is thrown at runtime.

D.

Compilation fails.

Question # 6

Which two of the following aren't the correct ways to create a Stream?

A.

Stream stream = Stream.of("a");

B.

Stream stream = Stream.ofNullable("a");

C.

Stream stream = Stream.generate(() -> "a");

D.

Stream stream = Stream.of();

E.

Stream stream = new Stream();

F.

Stream stream = Stream.builder().add("a").build();

G.

Stream stream = Stream.empty();

Question # 7

Given:

java

Optional o1 = Optional.empty();

Optional o2 = Optional.of(1);

Optional o3 = Stream.of(o1, o2)

.filter(Optional::isPresent)

.findAny()

.flatMap(o -> o);

System.out.println(o3.orElse(2));

What is the given code fragment's output?

A.

1

B.

2

C.

Optional.empty

D.

0

E.

An exception is thrown

F.

Optional[1]

G.

Compilation fails

Question # 8

Given:

java

Runnable task1 = () -> System.out.println("Executing Task-1");

Callable task2 = () -> {

System.out.println("Executing Task-2");

return "Task-2 Finish.";

};

ExecutorService execService = Executors.newCachedThreadPool();

// INSERT CODE HERE

execService.awaitTermination(3, TimeUnit.SECONDS);

execService.shutdownNow();

Which of the following statements, inserted in the code above, printsboth:

"Executing Task-2" and "Executing Task-1"?

A.

execService.call(task1);

B.

execService.call(task2);

C.

execService.execute(task1);

D.

execService.execute(task2);

E.

execService.run(task1);

F.

execService.run(task2);

G.

execService.submit(task1);

Question # 9

Given:

java

StringBuilder result = Stream.of("a", "b")

.collect(

() -> new StringBuilder("c"),

StringBuilder::append,

(a, b) -> b.append(a)

);

System.out.println(result);

What is the output of the given code fragment?

A.

cbca

B.

acb

C.

cacb

D.

abc

E.

bca

F.

cba

G.

bac

Question # 10

Given:

java

System.out.print(Boolean.logicalAnd(1 == 1, 2 < 1));

System.out.print(Boolean.logicalOr(1 == 1, 2 < 1));

System.out.print(Boolean.logicalXor(1 == 1, 2 < 1));

What is printed?

A.

truetruefalse

B.

falsetruetrue

C.

truefalsetrue

D.

truetruetrue

E.

Compilation fails

Go to page: