Weekend Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70percent

Oracle 1z0-829 Java SE 17 Developer Exam Practice Test

Demo: 15 questions
Total 50 questions

Java SE 17 Developer Questions and Answers

Question 1

Given the code fragment:

abstract sealed interface SInt permits Story, Art { default String getTitle() { return "Book Title" ; }

}

Which set of class definitions compiles?

Options:

A.

Interace story extends STnt {}

Interface Art extends SInt {}

B.

Public interface story extends sInd {}

Public interface Art extends SInt {}

C.

Sealed interface Storty extends sInt {}

Non-sealed class Art implements Sint {}

D.

Non-sealed interface story extends SInt {}

Class Art implements Sint {}

E.

Non-sealed interface story extends SInt {}

Non-sealed interaface Art extends Sint {}

Question 2

Given the code fragment:

What is the result?

Options:

A.

Range 1

Range 2

Range 3

B.

Range1

Note a valid rank.

C.

Range 1

Range 2

Range 3

Range 1

Not a valida rank

D.

Range 1

Question 3

Which statement is true about migration?

Options:

A.

Every module is moved to the module path in a top-down migration.

B.

Every module is moved to the module path in a bottom-up migration.

C.

The required modules migrate before the modules that depend on them in a top-down ^migration.

D.

Unnamed modules are automatic modules in a top-down migration.

Question 4

Which statement is true?

Options:

A.

The tryLock () method returns a boolean indicator immediately regardless if it has or has not managed to acquire the lock.

B.

The tryLock () method returns a boolean indicator immediately if it has managed to acquire the lock, otherwise it waits for the lock acquisition.

C.

The lock () method returns a boolean indicator immediately if it has managed to acquire the lock, otherwise it waits for the lock acquisition.

D.

The Lock () method returns a boolean indicator immediately regardless if it has or has not managed to acquire the lock

Question 5

Given the content of the in. tart file:

23456789

and the code fragment:

What is the content of the out .txt file?

Options:

A.

01234567801234

B.

012345678

C.

0123456789234567

D.

0123456789

E.

012345678901234

F.

01234567

Question 6

Given the code fragment:

What is the result?

Options:

A.

Logged out at: 2021-0112T21:58:19.880z

B.

Logged out at: 2021-01-12T21:58:00z

C.

A compilation error occurs at Line n1.

D.

Can’t logout

Question 7

Given the code fragment:

What is the result?

Options:

A.

$SIM6D

B.

PT5000PT60MP6D

C.

PT5SPTIMP6D

D.

5000$60M6D

Question 8

Given:

What is the result?

Options:

A.

Software Game Chess 0

B.

Software Game Software Game Chese 2

C.

Software game write error

D.

Software Game Software Game chess 0

E.

Software Game Chess 2

F.

Software Game read error

Question 9

Given the product class:

And the shop class:

What is the result?

Options:

A.

Cookie 2.99 2.99

B.

Cookie 3.99 2.99

C.

Cookie 0.0 0.0

D.

An exception is produced at runtime

E.

Compilation fails

F.

Cookie 0.0 2.99

Question 10

Given:

Which two should the module-info file include for it to represent the service provider interface?

Options:

A.

Requires cm.transport.vehicle,cars:

B.

Provides.com.transport.vehicle.cars.Car with com.transport.vehicle.cars. impt, CatImpI;

C.

Requires cm.transport.vehicle,cars:

D.

Provides.com.transport.vehicle.cars.Car impl,CarImp1 to com.transport.vehicle.cars. Cars

E.

exports com.transport.vehicle.cars.Car;

F.

Exports com.transport.vehicle.cars;

G.

Exports com.transport.vehicle;

Question 11

Given:

What is the result?

Options:

A.

Tablechair Tablechair

B.

Wtablechair tableChair

C.

A RuntimeException is thrown

D.

wTableChair TableChair

E.

Compilation fails

Question 12

Given the code fragments:

Which action prints Wagon : 200?

Options:

A.

At line n1, implement the java.io, Serializable interface.

B.

At line n3, replace readObject (0 with readLine().

C.

At Line n3, replace Car with LuxurayCar.

D.

At Line n1, implement the java.io.AutoCloseable interface

E.

At line n2, in the main method signature, add throws IOException, ClassCastException.

F.

At line n2, in the main method signature, add throws IoException, ClassNotFoundException.

Question 13

Given:

What is the result?

Options:

A.

4

B.

2

C.

6

D.

Nothing is printed because of an indefinite loop.

E.

Compilation fails.

F.

5

G.

A runtime exception is thrown.

Question 14

Given the code fragment:

What is the result?

Options:

A.

0

B.

2

C.

-2

D.

2

2

0

E.

1

1

1

F.

1

2

-4

Question 15

Given the code fragment:

What is the result?

Options:

A.

False true true optional (Newyear)

B.

0110

C.

True true false NewYear

D.

010 optional (Newyear)

Demo: 15 questions
Total 50 questions