This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Imports - static and otherwise Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Imports - static and otherwise" Watch "Imports - static and otherwise" New topic

Imports - static and otherwise

matt love
Ranch Hand

Joined: Jan 25, 2010
Posts: 67
From B and S practice exams, Exam 4, number 9, page 369.

Using Eclipse, I have 2 files:

Note: Unlike the actual question from the book, I have added "package com"; to the Theorics file.

Which are the minimum line(s) of code to add at "insert code here" for the files to compile?
(Choose all that apply.)
A. import static com.*;
B. import com.Extramuros;
C. import com.Extramuros.*;
D. import static com.Extramuros;
E. import static com.Extramuros.*;
F. Even with correct imports, the code will not compile due to other errors

Book's answer is B and E.

When I add only line E to Theorics, all compile issues are resolved.

When I add only line B to Theorics, nothing changes.

Why does B and S say B is a required correct answer?



Helen Ma
Ranch Hand

Joined: Nov 01, 2011
Posts: 451
Extramurous and Theoric are two classes in the same package called com.
I don't think in, we don't need to import com.Extramurous.

I guess B is not necessary.

What do all of you think?
subject: Imports - static and otherwise
Similar Threads
Doubt regarding static context
K&B Ch10#8 protected access question
import static question
Thinking in Java 3e, chapter 5, classpath woes
Doubt About Mock Exam Question?