• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Imports - static and otherwise

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Thanks.

Matt

 
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Extramurous and Theoric are two classes in the same package called com.
I don't think in Theoric.java, we don't need to import com.Extramurous.

I guess B is not necessary.

What do all of you think?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic