• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Sybex Study Guide 1Z0-815 Page 486 Review Question #7

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a question about review question #7 on page 486 of the Study Guide for exam 1Z0-815.

The review question asks:

Suppose module puppy depends on module dog and module dog depends on module animal. Which two lines allow module puppy to access the animal.behavior package in module anima? (Choose two)



The correct answer according to page 526 are D (requires on line T) and G (requires transitive on line S).

As I see it, the package animal.behavior can never be accessed from within module puppy directly, because it is only exported explicitly to module dog.
I have the following code:







When compiling the puppy module, I get the following error


When I change the module-info.java from module animal so that it only reads "exports animal.behavior" (without the "to dog" at the end). The code runs successfully and prints "behave!".
Am I missing something?
 
author & internet detective
Posts: 39996
807
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christian,
You are correct. This is an error. Adding to the errata now. (It shouldn't say "to dog")
 
Christian Schulz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,

thanks for your reply. Glad I understood it correctly.
 
Run away! Run away! Here, take this tiny ad with you:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic