1Z0-811 Java Basics and Syntax Practice Question
A package named com.example.util is declared in a file. Where should the file be placed in the directory structure?
⚠ Common exam trap
A common mix-up: candidates confuse the package name with a file name or think the directory structure can be flattened, leading them to pick options that treat the package as a single folder or as a file extension.
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
✓
com/example/util/
Java requires that the directory structure of a package matches the package declaration. A package named `com.example.util` must be stored in a directory hierarchy `com/example/util/` so that the Java compiler and runtime can locate the class files based on the fully qualified name. This ensures that the file is accessible via the classpath or module path.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
com.example.util/
Why it's wrong here
Dots are not directory separators on file system.
- ✗
util/
Why it's wrong here
Missing com/example directories.
- ✓
com/example/util/
Why this is correct
Directory path matching package hierarchy.
- ✗
com/example/util.java
Why it's wrong here
This is a file path, not directory.
Go deeper
Related to this question
About these practice questions
One of 481 original 1Z0-811 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-811 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-811 exam.