Vcehome > Oracle > Oracle Java > 1Z0-811 > 1Z0-811 Online Practice Questions and Answers

1Z0-811 Online Practice Questions and Answers

Questions 4

Given the code fragment:

Which statement is true?

A. The code results in a compilation error. To make it compile, insert at line n1: import java.lang.Math; import java.lang.Random;

B. The code compiles successfully

C. The code results in a compilation error. To make it compile, insert at line n1: import java.lang; import java.util;

D. The code results in a compilation error. To make it compile, insert at line n1: import java.util.*;

Browse 75 Q&As
Questions 5

Given the code:

Which code fragment, when inserted at line n1, enables the code to print sum is 30?

A. int sum(int a, b) {

B. int sum(int a, int b) {

C. int sum(int, int) {

D. int sum(int[] a, b) {

Browse 75 Q&As
Questions 6

Given the code fragment: What is the result?

A. false false -1

B. true false 0

C. true true 0

D. false true -1

Browse 75 Q&As
Questions 7

Identify two class variables.

A. private static int numberOfSquares = 20;

B. public static int counter = 0;

C. private Measure cm;

D. public int size = 10;

E. int scale = 35;

Browse 75 Q&As
Questions 8

Which statement is valid?

A. int 2 totalScore = 0;

B. int total-score = 0;

C. int totalScore2 = 0;

D. int total score = 0;

Browse 75 Q&As
Questions 9

Given the code fragment:

What is the result?

A. false false

B. true true

C. true false

D. false true

Browse 75 Q&As
Questions 10

Given the code fragment: What is the result?

A. [jasmine, rose, lily]

B. A runtime exception is thrown.

C. [jasmine, lily, lotus]

D. [jasmine, rose, lotus, lily]

Browse 75 Q&As
Questions 11

Given the code fragment:

Which statement, when inserted at line n1, enables the code to print 0 2 4 6 8 10?

A. count = (count++) +1;

B. count = count++;

C. count =+ 2;

D. count += 2;

Browse 75 Q&As
Questions 12

Given the code fragment:

What is the result?

A. 3 : 1

B. 3 : 2

C. 0 : 1

D. 2 : 0

Browse 75 Q&As
Questions 13

Given the code fragment:

What is the result?

A. 25.67

B. 25.00

C. 25.7

D. 26

Browse 75 Q&As
Exam Code: 1Z0-811
Exam Name: Java Foundations
Last Update: May 11, 2024
Questions: 75 Q&As

PDF

$49.99

VCE

$59.99

PDF + VCE

$67.99