Oracle 1z0-816 Exam Practice Questions (P. 1)
- Full Access (80 questions)
- One Year of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #1
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?
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?
- A/scratch/exam/new.txt and /scratch/new.txt are deleted.
- BThe program throws a FileaAlreadyExistsException.
- CThe program throws a NoSuchFileException.
- DA copy of /scratch/exam/new.txt exists in the /scratch directory and /scratch/exam/new.txt is deleted.
Correct Answer:
C
C
send
light_mode
delete
Question #2
Which two are functional interfaces? (Choose two.)
send
light_mode
delete
Question #3
Given the declaration:

Examine this code fragment:
/* Loc1 */ class ProcessOrders { ... }
Which two annotations may be applied at Loc1 in the code fragment? (Choose two.)

Examine this code fragment:
/* Loc1 */ class ProcessOrders { ... }
Which two annotations may be applied at Loc1 in the code fragment? (Choose two.)
- A@Resource(priority=100)
- B@Resource(priority=0)
- C@Resource(name=“Customer1”, priority=100)Most Voted
- D@Resource(name=“Customer1”)Most Voted
- E@Resource
Correct Answer:
AB
AB
send
light_mode
delete
Question #4
Given:

Which two interfaces can be used in lambda expressions? (Choose two.)

Which two interfaces can be used in lambda expressions? (Choose two.)
- AMyInterface1Most Voted
- BMyInterface3
- CMyInterface5
- DMyInterface2Most Voted
- EMyInterface4
Correct Answer:
CD
CD
send
light_mode
delete
Question #5
Given this enum declaration:

Examine this code:
System.out.println(Alphabet.getFirstLetter());
What code should be written at line 3 to make this code print A?

Examine this code:
System.out.println(Alphabet.getFirstLetter());
What code should be written at line 3 to make this code print A?
- Afinal String getFirstLetter() { return A.toString(); }
- Bstatic String getFirstLetter() { return Alphabet.values()[1].toString(); }
- Cstatic String getFirstLetter() { return A.toString(); }
- DString getFirstLetter() { return A.toString(); }
Correct Answer:
C
C
send
light_mode
delete
All Pages





