Spring Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: buysanta

Exact2Pass Menu

Java SE 21 Developer Professional

Last Update 15 hours ago Total Questions : 84

The Java SE 21 Developer Professional content is now fully updated, with all current exam questions added 15 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

Which methods compile?

A.

```java public List < ? super IOException > getListSuper() { return new ArrayList < Exception > (); }

csharp

B.

```java

public List < ? extends IOException > getListExtends() {

return new ArrayList < FileNotFoundException > ();

}

C.

```java public List < ? extends IOException > getListExtends() { return new ArrayList < Exception > (); }

csharp

D.

```java

public List < ? super IOException > getListSuper() {

return new ArrayList < FileNotFoundException > ();

}

Question # 5

Given:

java

public class Test {

public static void main(String[] args) throws IOException {

Path p1 = Path.of("f1.txt");

Path p2 = Path.of("f2.txt");

Files.move(p1, p2);

Files.delete(p1);

}

}

In which case does the given program throw an exception?

A.

Neither files f1.txt nor f2.txt exist

B.

Both files f1.txt and f2.txt exist

C.

An exception is always thrown

D.

File f2.txt exists while file f1.txt doesn't

E.

File f1.txt exists while file f2.txt doesn't

Question # 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?

A.

None of the above

B.

C

C.

A

D.

E

E.

B

F.

D

Question # 7

What does the following code print?

java

import java.util.stream.Stream;

public class StreamReduce {

public static void main(String[] args) {

Stream < String > stream = Stream.of("J", "a", "v", "a");

System.out.print(stream.reduce(String::concat));

}

}

A.

Optional[Java]

B.

Java

C.

null

D.

Compilation fails

Question # 8

A module com.eiffeltower.shop with the related sources in the src directory.

That module requires com.eiffeltower.membership, available in a JAR located in the lib directory.

What is the command to compile the module com.eiffeltower.shop?

A.

bash

CopyEdit

javac -source src -p lib/com.eiffel.membership.jar -d out -m com.eiffeltower.shop

B.

css

CopyEdit

javac --module-source-path src -p lib/com.eiffel.membership.jar -d out -m com.eiffeltower.shop

C.

css

CopyEdit

javac --module-source-path src -p lib/com.eiffel.membership.jar -s out -m com.eiffeltower.shop

D.

css

CopyEdit

javac -path src -p lib/com.eiffel.membership.jar -d out -m com.eiffeltower.shop

Question # 9

Given:

java

StringBuffer us = new StringBuffer("US");

StringBuffer uk = new StringBuffer("UK");

Stream < StringBuffer > stream = Stream.of(us, uk);

String output = stream.collect(Collectors.joining("-", "=", ""));

System.out.println(output);

What is the given code fragment's output?

A.

US-UK

B.

An exception is thrown.

C.

-US=UK

D.

=US-UK

E.

Compilation fails.

F.

US=UK

Question # 10

Given:

java

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

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

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

System.out.println(result);

What is the output of this code fragment?

A.

United-States

B.

United-STATES

C.

UNITED-STATES

D.

-UnitedStates

E.

-UNITEDSTATES

F.

-UnitedSTATES

G.

UnitedStates

Go to page: