Weekend Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: dumps65

Oracle 1z0-811 Dumps

Page: 1 / 8
Total 75 questions

Java Foundations Questions and Answers

Question 1

Which statement is valid?

Options:

A.

int 2 totalScore = 0;

B.

int total–score = 0;

C.

int totalScore2 = 0;

D.

int total score = 0;

Question 2

Given the code fragment:

as

What is the result?

Options:

A.

Unknown issues.

Invalid divisor.

B.

Unknown issues.

C.

Invalid divisor.

D.

A compilation error occurs.

Question 3

Given the code fragment:

as

What is the result?

Options:

A.

456789

B.

4567889

C.

45678

D.

3456789

Question 4

Given:

as

What is the result?

Options:

A.

Compilation fails. To make it compile, replace line n1 with var1 = 0;

B.

Compilation fails. To make it compile, replace line n2 with var2 = 0;

C.

0

D.

Nothing is printed.

Question 5

Given:

as

What is the result?

Options:

A.

A compilation error occurs in the modify method.

B.

99

C.

5

D.

A compilation error occurs in the main method.

Question 6

Which statement is true about a mutator method?

Options:

A.

It replaces the default constructor.

B.

It returns mutated instance members.

C.

It must be declared private.

D.

It can be used to assign data to instance members.

Question 7

Given the code fragment:

as

What is the result?

Options:

A.

true

true

B.

true

false

C.

false

false

D.

false

true

Question 8

Given the code fragment:

as

Which code fragment, when inserted at line n1, enables the code to print Java Programming:1?

Options:

A.

System.out.println(name + “:” + count);

B.

System.out.println(c.name + “:” + count);

C.

System.out.println(c.name + “:” + Course.count);

D.

System.out.println(Course.name + “:” + c.count);

Question 9

Given the code fragment:

as

Which code fragment can be inserted at line n1 to enable the code to print 0.0?

Options:

A.

Ball b = null;

B.

weight = 0.0;

C.

Ball.weight = 0.0;

D.

Ball b = new Ball(0.0);

E.

Ball b = new Ball();

Question 10

Given the code fragment:

as

What is the result?

Options:

A.

[jasmine, rose, lily]

B.

A runtime exception is thrown.

C.

[jasmine, lily, lotus]

D.

[jasmine, rose, lotus, lily]

Question 11

Which method identifier is correct according to Java naming conventions?

Options:

A.

BillCalculator

B.

calculateBill

C.

calculatebill

D.

Calculator

Page: 1 / 8
Total 75 questions