Winter Special - Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: top65certs

Free and Premium Oracle 1z0-829 Dumps Questions Answers

Page: 1 / 4
Total 50 questions

Java SE 17 Developer Questions and Answers

Question 1

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

Buy Now
Question 2

Given the code fragment:

Options:

A.

True:false:true:true

B.

True:true:false:false

C.

True:false:true:false

D.

True:false:false:false

Question 3

Given the code fragment:

Which action enables the code to compile?

Options:

A.

Replace record with void.

B.

Remove the regNO initialization statement.

C.

Make the regNo variable static.

D.

Replace thye regNo variable static

E.

Make the regNo variable public

Question 4

Assuming that the data, txt file exists and has the following content:

Text1

Text2

Text3

Given the code fragment:

What is the result?

Options:

A.

text1-

text2-

text3-

text3

B.

text1-text2-text3

text1

text2

text3

C.

text1-text2-text3

A java.lang.indexoutofBoundsException is thrown.

D.

text1-text2-text3

text3

Question 5

Given the code fragment:

What is the result?

Options:

A.

81111

B.

8109

C.

777

D.

71010

E.

888

F.

7107

Question 6

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 7

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 8

Given:

Which statement is true while the program prints GC?

Options:

A.

Only the object referenced by t2 is eligible for garbage collection.

B.

Both the objects previously referenced by t1 are eligible for garbage collection.

C.

None of the objects are eligible for garbage collection.

D.

Only one of the objects previously referenced by t1 is eligible for garbage collection.

Question 9

Given:

What is the result?

Options:

A.

1001

1001

1000

B.

101

101

1000

C.

100

100

1000

D.

1001

100

1000

Question 10

Which two code fragments compile?

A)

B)

C)

D)

E)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Question 11

Given:

Which statement is true?

Options:

A.

The program throws StockException.

B.

The program fails to compile.

C.

The program throws outofStockException.

D.

The program throws ClassCastException

Question 12

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 13

Daylight Saving Time (DST) is the practice of advancing clocks at the start of spring by one hour and

adjusting them backward by one hour in autumn.

Considering that in 2021, DST in Chicago (Illinois) ended on November 7th at 2 AM, and given the fragment:

What is the output?

Options:

A.

true

false

B.

False

false

C.

true

true

D.

false

true

Question 14

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 15

Given:

Options:

A.

Hello

B.

Compilation fails

C.

A NumberFormatException is thrown

D.

there

Page: 1 / 4
Total 50 questions