Question 240 of 509
Java I/O API and Securing ApplicationsmediumMultiple SelectObjective-mapped

Quick Answer

The correct answer is that the `java.nio.file.Files` class provides dedicated methods for symbolic link operations, such as `createSymbolicLink()`, `readSymbolicLink()`, and `isSymbolicLink()`, which are absent from the older `java.io` package. This is because NIO.2 was designed to offer robust support for file system metadata and attributes, including the ability to create, detect, and follow symbolic links directly, whereas `java.io` treats links as regular files without exposing their link-specific behavior. On the Oracle Certified Professional Java SE 17 Developer 1Z0-829 exam, this distinction tests your understanding of how NIO.2 modernizes file handling by separating file system operations from stream-based I/O. A common trap is assuming `java.io.File` can handle symbolic links, but it lacks the granular control that NIO.2 provides through the `Files` utility class. Memory tip: think of NIO.2 as the "link-aware" API—if you need to create or inspect a symbolic link, always reach for `java.nio.file.Files`.

1Z0-829 Java I/O API and Securing Applications Practice Question

This 1Z0-829 practice question tests your understanding of java i/o api and securing applications. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Which TWO statements about java.io and java.nio.file packages are true?

Question 1mediummulti select
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

java.nio.file.Files class provides methods for operating on symbolic links.

Option B is correct because the `java.nio.file.Files` class provides methods such as `createSymbolicLink()`, `readSymbolicLink()`, and `isSymbolicLink()` that directly operate on symbolic links in the file system. This is a key feature of the NIO.2 API, which offers comprehensive support for file system metadata and link management, unlike the older `java.io` package.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • java.io.Console can be used to read from and write to the standard streams of the JVM.

    Why it's wrong here

    Console is for interacting with the system console, not general streams.

  • java.nio.file.Files class provides methods for operating on symbolic links.

    Why this is correct

    Files has methods like isSymbolicLink, createSymbolicLink, etc.

    Related concept

    Read the scenario before looking for a memorised answer.

  • java.io.RandomAccessFile can be used for both reading and writing to a file.

    Why this is correct

    RandomAccessFile supports read and write operations.

    Related concept

    Read the scenario before looking for a memorised answer.

  • java.io.FileInputStream supports the mark and reset methods.

    Why it's wrong here

    FileInputStream does not support mark/reset; BufferedInputStream does.

  • java.nio.file.Path is a class that represents a file path.

    Why it's wrong here

    Path is an interface, not a class.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often confuse `java.io.Console` with standard streams or assume `Path` is a concrete class, and they may overlook that `FileInputStream` lacks mark/reset support, leading them to select incorrect options based on superficial familiarity.

Detailed technical explanation

How to think about this question

Under the hood, `Files` methods for symbolic links rely on platform-specific system calls (e.g., `symlink()` on POSIX systems or `CreateSymbolicLink()` on Windows with appropriate privileges). A subtle behavior is that `Files.isSymbolicLink()` returns `true` only for the link itself, not the target, and operations like `Files.readAttributes()` can follow links by default unless `LinkOption.NOFOLLOW_LINKS` is specified. In real-world scenarios, this is critical for secure file traversal and avoiding infinite loops or unauthorized access.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A small business has 20 workstations on the 192.168.1.0/24 network and one public IP from its ISP. The router uses PAT (NAT overload) so all 20 devices share one public address using different source ports. NAT questions test whether you understand the four address terms and which direction each translation applies.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related 1Z0-829 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free 1Z0-829 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this 1Z0-829 question test?

Java I/O API and Securing Applications — This question tests Java I/O API and Securing Applications — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: java.nio.file.Files class provides methods for operating on symbolic links. — Option B is correct because the `java.nio.file.Files` class provides methods such as `createSymbolicLink()`, `readSymbolicLink()`, and `isSymbolicLink()` that directly operate on symbolic links in the file system. This is a key feature of the NIO.2 API, which offers comprehensive support for file system metadata and link management, unlike the older `java.io` package.

What should I do if I get this 1Z0-829 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more ways this is tested on 1Z0-829

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Which statement about java.io and java.nio.file packages is true?

easy
  • A.The java.nio.file package provides support for symbolic links and file attributes
  • B.Classes in java.nio.file are thread-safe by default
  • C.The java.io package includes the Path interface
  • D.The java.nio.file package is deprecated in favor of java.io

Why A: Option A is correct because the java.nio.file package (part of NIO.2) explicitly provides support for symbolic links via methods like Files.createSymbolicLink() and Files.isSymbolicLink(), and it offers comprehensive file attribute access through classes like BasicFileAttributes, DosFileAttributes, and PosixFileAttributes, which are not available in java.io.

Keep practising

More 1Z0-829 practice questions

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This 1Z0-829 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-829 exam.