Black Friday Sale - Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70dumps

1z0-819 Questions and Answers

Question # 6

Which two modules include APIs in the Java SE Specification? (Choose two.)

A.

java.logging

B.

java.desktop

C.

javafx

D.

jdk.httpserver

E.

jdk.jartool

Full Access
Question # 7

Given:

Which two lines inserted in line 1 will allow this code to compile? (Choose two.)

A.

protected void walk(){}

B.

void walk(){}

C.

abstract void walk();

D.

private void walk(){}

E.

public abstract void walk();

Full Access
Question # 8

Given:

Which two statements are valid to be written in this interface? (Choose two.)

A.

public abstract void methodB();

B.

final void methodG(){System.out.println(“G”);}

C.

private abstract void methodC();

D.

public String methodD();

E.

public int x;

F.

final void methodE();

G.

public void methodF(){System.out.println(“F”);}

Full Access
Question # 9

Given:

And the command:

java Main Helloworld

What is the result ?

A.

Input: Echo:

B.

Input: Helloworld Echo: Helloworld

C.

Input:

Then block until any input comes from System.in.

D.

Input:

Echo: Helloworld

E.

A NullPointerException is thrown at run time.

Full Access
Question # 10

Given:

How many LocalDate objects are created in this example?

A.

2

B.

3

C.

4

D.

5

Full Access
Question # 11

Which interface in the java.util.function package will return a void return type?

A.

Supplier

B.

Predicate

C.

Function

D.

Consumer

Full Access
Question # 12

Given the code fragment:

Path source = Paths.get(“/repo/a/a.txt”);

Path destination = Paths.get(“/repo”);

Files.move(source, destination); // line 1

Files.delete (source); // line 2

Assuming the source file and destination folder exist, what Is the result?

A.

A java.nio.file.FileAlreadyExistsException is thrown on line 1.

B.

A java.nio.file.NoSuchFileException is thrown on line 2.

C.

A copy of /repo/a/a.txt is moved to the /repo directory and /repo/a/a.txt is deleted.

D.

a.txt is renamed repo.

Full Access
Question # 13

Which two statements are correct about modules in Java? (Choose two.)

A.

java.base exports all of the Java platforms core packages.

B.

module-info.java can be placed in any folder inside module-path.

C.

A module must be declared in module-info.java file.

D.

module-info.java cannot be empty.

E.

By default, modules can access each other as long as they run in the same folder.

Full Access
Question # 14

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"))

Full Access
Question # 15

There is a copyServiceAPI that has the org.copyservice. spi. Copy interface

To use this service in a module, which module- info.java would be correct?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 16

Given:

Assume the file on path does not exist. What is the result?

A.

The compilation fails.

B.

/u01/work/filestore.txt is not deleted.

C.

Exception

D.

/u01/work/filestore.txt is deleted.

Full Access
Question # 17

Given:

What is the result?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 18

Given:

What is the result?

A.

9

B.

An exception is thrown at runtime.

C.

3

D.

6

Full Access
Question # 19

Why does this compilation fail?

A.

The method Y. print (object) does not call the method super.print (object)

B.

The method x. print (object) is not accessible to Y.

C.

In method x. print (Collection), system. Out :: prints is an invalid Java identifier.

D.

The method print (object) and the method print (object…) are duplicates of each other.

E.

The method Y. print (object…) cannot override the final method x.print (object….).

Full Access
Question # 20

Given:

List longlist = List.of(“Hello”,”World”,”Beat”);

List shortlist = new ArrayList<>();

Which code fragment correctly forms a short list of words containing the letter “e”?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 21

Given:

What is the result?

A.

nothing

B.

It fails to compile.

C.

0

D.

A java.lang.IllegalArgumentException is thrown.

E.

10

Full Access
Question # 22

Given:

and:

Which code, when inserted on line 10, prints the number of unique localities from the roster list?

A.

.map(Employee::getLocality)

.distinct()

.count();

B.

map(e −> e.getLocality())

.count();

C.

.map(e −> e.getLocality())

.collect(Collectors.toSet())

.count();

D.

.filter(Employee::getLocality)

.distinct()

.count();

Full Access
Question # 23

Given:

What is the result?

A.

Joe

null

B.

null

Mary

C.

Joe

Marry

D.

null

null

Full Access
Question # 24

Given:

It is required that if p instanceof Pair then p.isValid() returns true.

Which is the smallest set of visibility changes to insure this requirement is met?

A.

setLeft and setRight must be protected.

B.

left and right must be private.

C.

isValid must be public.

D.

left, right, setLeft, and setRight must be private.

Full Access
Question # 25

Given:

Which one is correct?

A.

An IllegalThreadStateException is thrown at run time.

B.

Three threads are created.

C.

The compilation fails.

D.

Four threads are created.

Full Access
Question # 26

Given:

Which two changes need to be made to make this class compile? (Choose two.)

A.

Change Line 1 to an abstract class:public abstract class API {

B.

Change Line 2 access modifier to protected:protected void checkValue(Object value)throws IllegalArgumentException;

C.

Change Line 1 to a class:public class API {

D.

Change Line 1 to extend java.lang.AutoCloseable:public interface API extends AutoCloseable {

E.

Change Line 2 to an abstract method:public abstract void checkValue(Object value)throws IllegalArgumentException;

Full Access
Question # 27

What makes Java dynamic?

A.

At runtime, classes are loaded as needed, and new code modules can be loaded on demand.

B.

The runtime can process machine language sources as well as executables from different language compilers.

C.

The Java compiler uses reflection to test if class methods are supported by resources of a target platform.

D.

The Java compiler preprocesses classes to run on specific target platforms.

Full Access
Question # 28

Given:

Which code, when inserted at one or more marked positions, would allow classes B and C to compile?

A.

@Override // position 3void x () {} // position 3@Override // position 3public void z() { } // position 3

B.

@Override // position 2public void z() { } // position 3

C.

implements A // position 1@Override // position 2

D.

public void z() { } // position 3

Full Access
Question # 29

Given:

What is the output?

A.

:APPLE:ORANGE:BANANA

appleorangebanana

B.

:APPLE:ORANGE:BANANA

C.

APPLE:apple ORANGE:orange BANANA:banana

D.

appleorangebanana

:APPLE:ORANGE:BANANA

E.

apple:APPLE orange:ORANGE banana:BANANA

Full Access
Question # 30

Given:

and

Which code fragment on line 1 makes the s1 set contain the names of all employees born before January 1, 1989?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 31

Given:

Which three are correct? (Choose three.)

A.

b1.foo(li) prints Hello world!

B.

f1.foo(li) prints Bonjour le monde!

C.

f1.foo(li) prints Hello world!

D.

f1.foo(li) prints Hola Mundo!

E.

b1.foo(li) prints Bonjour le monde!

F.

f2.foo(li) prints Hola Mundo!

G.

f2.foo(li) prints Bonjour le monde!

Full Access
Question # 32

Given the code fragment:

What is the result?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 33

What change will cause the code to compile successfully?

A.

Insert PriceChecker (?) prod on line 1.

B.

Insert PriceChecker <> prod on line 1.

C.

Insert PriceChecker prod on line 1.

D.

Insert PriceChecker prod on line 1.

Full Access
Question # 34

Which set of commands is necessary to create and run a custom runtime image from Java source files?

A.

java, jdeps

B.

javac, jlink

C.

jar, jlink

D.

javac, jar

Full Access
Question # 35

Given the code fragment:

What is the output?

A.

The compilation fails.

B.

[-1, -2, -3]

C.

[-3, -2, -1]

D.

A runtime exception is thrown.

Full Access
Question # 36

Which two describe reasons to modularize the JDK? (Choose two.)

A.

easier to understand the Java language

B.

improves security and maintainability

C.

easier to expose implementation details

D.

improves application robustness

E.

easier to build a custom runtime linking application modules and JDK modules

Full Access
Question # 37

Which two statements correctly describe capabilities of interfaces and abstract classes? (Choose two.)

A.

Interfaces cannot have protected methods but abstract classes can.

B.

Both interfaces and abstract classes can have final methods.

C.

Interfaces cannot have instance fields but abstract classes can.

D.

Interfaces cannot have static methods but abstract classes can.

E.

Interfaces cannot have methods with bodies but abstract classes can.

Full Access
Question # 38

And the code fragment:

Which situation will occur on code fragment execution?

A.

Livelock

B.

Deadlock

C.

Race Condition

D.

Starvation

Full Access