Certbus > Oracle > Java SE > 1Z0-819 > 1Z0-819 Online Practice Questions and Answers

1Z0-819 Online Practice Questions and Answers

Questions 4

Given: What is the output?

A. Hello world!Bonjour le monde!

B. Hello world!Hello world!

C. Bonjour le monde!Hello world!

D. Bonjour le monde!Bonjour le monde!

Browse 315 Q&As
Questions 5

Which two var declarations are correct? (Choose two.)

A. var names = new ArrayList<>();

B. var _ = 100;

C. var var = "hello";

D. var y = null;

E. var a;

Browse 315 Q&As
Questions 6

Given:

What is the result?

A. 2-4

B. 0-6 1-5 2-4

C. 1-5

D. 1-5 2-4

E. The compilation fails due to an error in line 1.

F. 0-6

G. 0-6 2-4

Browse 315 Q&As
Questions 7

Given the code fragment:

How many lines of text does this program print?

A. four

B. one

C. three

D. two

Browse 315 Q&As
Questions 8

Given: What must be added in line 1 to compile this class?

A. catch(IOException e) { }

B. catch(FileNotFoundException | IndexOutOfBoundsException e) { }

C. catch(FileNotFoundException | IOException e) { }

D. catch(IndexOutOfBoundsException e) { }catch(FileNotFoundException e) { }

E. catch(FileNotFoundException e) { }catch(IndexOutOfBoundsException e) { }

Browse 315 Q&As
Questions 9

Which two expressions create a valid Java Path instance? (Choose two.)

A. Paths.get("foo")

B. Paths.getPath("too")

C. Path.get(new URI("file:///domains/oracle/test.txt"))

D. new Path("foo")

E. Paths.get(URL.create("file:///domains/oracle/test.txt"))

Browse 315 Q&As
Questions 10

Given:

public class X {

}

and

public final class Y extends X {

}

What is the result of compiling these two classes?

A. The compilation fails because there is no zero args constructor defined in class X.

B. The compilation fails because either class X or class Y needs to implement the toString() method.

C. The compilation fails because a final class cannot extend another class.

D. The compilation succeeds.

Browse 315 Q&As
Questions 11

Which two statements independently compile? (Choose two.)

A. List list = new ArrayList();

B. List list = new ArrayList();

C. List list = new ArrayList();

D. List list = new ArrayList();

E. List list = new ArrayList();

Browse 315 Q&As
Questions 12

Which three annotation uses are valid? (Choose three.)

A. Function func = (@NonNull x) > x.toUpperCase();

B. var v = "Hello" + (@Interned) "World"

C. Function func = (var @NonNull x) > x.toUpperCase();

D. Function func = (@NonNull var x) > x.toUpperCase();

E. var myString = (@NonNull String) str;

F. var obj = new @Interned MyObject();

Browse 315 Q&As
Questions 13

Given:

What is the result?

A. An indexOutofBoundsException is thrown at runtime.

B. At once 0

C. Hat at store 4

D. At once 1

E. Hat at store 1

Browse 315 Q&As
Questions 14

Given:

List list1 = new ArrayList<>();

list1.add("A");

list1.add("B");

List list2 = List.copyOf(list1);

list2.add("C");

List> list3 = List.of(list1, list2);

System.out.println(list3);

What is the result?

A. [[A, B],[A, B]]

B. An exception is thrown at run time.

C. [[A, B], [A, B, C]]

D. [[A, B, C], [A, B, C]]

Browse 315 Q&As
Questions 15

Which two safely validate inputs? (Choose two.)

A. Delegate numeric range checking of values to the database.

B. Accept only valid characters and input values.

C. Use trusted domain-specific libraries to validate inputs.

D. Assume inputs have already been validated.

E. Modify the input values, as needed, to pass validation.

Browse 315 Q&As
Questions 16

Given:

What is known about the Sportscar class?

A. The Sportscar class is a subclass of Automobile and inherits its methods.

B. The Sportscar subclass cannot override setTurbo method from the superclass Automobile.

C. The Sportscar class is a superclass that has more functionality than the Automobile class.

D. The Sportscar class inherits the setTurbo method from the superclass Automobile.

Browse 315 Q&As
Questions 17

Given the content: What is the result?

A. Option A

B. Option B

C. Option C

D. Option D

E. Option E

Browse 315 Q&As
Questions 18

Given:

What is the result?

A. A java.util.NoSuchElementException is thrown at run time.

B. Ans : a

C. The compilation fails.

D. Ans :

Browse 315 Q&As
Exam Code: 1Z0-819
Exam Name: Java SE 11 Developer
Last Update: Apr 28, 2024
Questions: 315 Q&As

PDF

$45.99

VCE

$49.99

PDF + VCE

$59.99