• 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

OCP 17 Study Guide - Online Test tb864585.JaSE17SG.c12.01

 
Greenhorn
Posts: 25
3
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Which statement is true of the following module?

|---zoo
  |-- staff
     |-- Vet.java

A. The directory structure shown is a valid module.
B. The directory structure would be a valid module if module.java were added directly underneath zoo/staff.
C. The directory structure would be a valid module if module.java were added directly underneath zoo.
D. The directory structure would be a valid module if module-info.java were added directly underneath zoo/staff.
E. The directory structure would be a valid module if module-info.java were added directly underneath zoo.
F. None of these changes would make this directory structure a valid module.


Answer:

Modules are required to have a module-info.java file at the root directory of the module. Option D matches this requirement.


Is that correct? I answered E, so that module-info file can export Vet.class through the package "staff", assuming Vet declares that is part of package staff.
 
Bartender
Posts: 3900
43
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The D is definitely wrong, because Vet class will be in unnamed package, whicle any class in a module must belong to some package.
 
author & internet detective
Posts: 41855
904
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The printed book has this as E. It was corrected in PDF review. Which means the online versions were based on the pre-edited PDF. Yuck. I added to my to do list to go over all such questions and report to the publisher.

Have a cow for stumbling on the error and alerting me.
 
reply
    Bookmark Topic Watch Topic
  • New Topic