Pass the Oracle Java SE 1z0-819 Questions and answers with CertsForce

Viewing page 1 out of 9 pages
Viewing questions 1-10 out of questions
Questions # 1:

Which describes an aspect of Java that contributes to high performance?

Options:

A.

Java prioritizes garbage collection.


B.

Java has a library of built-in functions that can be used to enable pipeline burst execution.


C.

Java monitors and optimizes code that is frequently executed.


D.

Java automatically parallelizes code execution.


Questions # 2:

Examine these module declarations:

Question # 2

Which two statements are correct? (Choose two.)

Options:

A.

The ServiceProvider module is the only module that, at run time, can provide the com.example.api API.


B.

The placement of the com.example.api API in a separate module, ServiceAPI, makes it easy to install multiple provider modules.


C.

The Consumer module should require the ServiceProvider module.


D.

The ServiceProvider module should export the com.myimpl package.


E.

The ServiceProvider module does not know the identity of a module (such as Consumer) that uses the

com.example.api API.


Questions # 3:

Given:

Question # 3

What is the result?

Options:

A.

Good Morning, Potter


B.

Good Night, Potter


C.

Good Morning, Harry


D.

Good Night, Harry


Questions # 4:

Given:

Question # 4

What is the result?

Options:

A.

NullPointerException is thrown at line 4.


B.

NullPointerException is thrown at line 10.


C.

A compilation error occurs.


D.

Hello


Questions # 5:

Question # 5

What change will cause the code to compile successfully?

Options:

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.


Questions # 6:

Given the code fragment:

Path currentFile = Paths.get(“/scratch/exam/temp.txt”);

Path outputFile = Paths get(“/scratch/exam/new.txt”);

Path directory = Paths.get(“/scratch/”);

Files.copy(currentFile, outputFile);

Files.copy(outputFile, directory);

Files.delete (outputFile);

The /scratch/exam/temp.txt file exists. The /scratch/exam/new.txt and /scratch/new.txt files do not exist.

What is the result?

Options:

A.

/scratch/exam/new.txt and /scratch/new.txt are deleted.


B.

The program throws a FileaAlreadyExistsException.


C.

The program throws a NoSuchFileException.


D.

A copy of /scratch/exam/new.txt exists in the /scratch directory and /scratch/exam/new.txt is deleted.


Questions # 7:

Given:

Question # 7

What is the result?

Options:

A.

5 4 3 2 1


B.

5


C.

nothing


D.

5 4 3 2 1 4 3 2 1 3 2 1 2 1 1


Questions # 8:

Given:

Question # 8

You want to implement the java. Io, serializable interface to the MypersisteneData class.

Which method should be overriden?

Options:

A.

The readExternal and writeExternal method


B.

The readExternal method


C.

The writeExternal method


D.

nothing


Questions # 9:

Given:

String originalPath = “data\\projects\\a-project\\..\\..\\another-project”;

Path path = Paths.get(originalPath);

System.out.print(path.normalize());

What is the result?

Options:

A.

data\another-project


B.

data\projects\a-project\another-project


C.

data\\projects\\a-project\\..\\..\\another-project


D.

data\projects\a-project\..\..\another-project


Questions # 10:

Question # 10

And the code fragment:

Question # 10

Which situation will occur on code fragment execution?

Options:

A.

Livelock


B.

Deadlock


C.

Race Condition


D.

Starvation


Viewing page 1 out of 9 pages
Viewing questions 1-10 out of questions