• 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
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

Sybex OCA Java 8 Study Guide wrong answer for chaper 1 question 14

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I just have checked the answers in Chapter 1 question 14 choices and found that it's wrong one.
I test the various package naming for Bird class, located in path: d:\my\education\oca8\src\my\directory\named\A\Bird.java when command line working directory was set at d:\my\education\oca8\src\my\directory.
I test in Windows 10 and with javac version 1.8.0_102.
I have success compilation and running of that class for all A,B,C,D,E,F variants on the Windows OS instead of only D, as mentioned in answers for book's questions.

For example, file contents:


And output of console was:


File contents:



And output was:



File contents:



And output was:


FIle contents:


And output was:


File contents:


Output was:


And finally, for file:


Output was:


In Linux bash I got:


For the same cases. So it's important a case in package name for Linux system and doesn't matter for Windows for execution, but we have success compilation all of cases in both system. And also we have success compilation and execution for other packages, not only for named.A in Linux system.

So, it's an stale information or disinformation in answer of book?
 
author & internet detective
Posts: 40286
819
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer is correct in the book. This is not a "choose all that apply" question. This means you have to pick the best answer.

This quesiton is testing your knowledge of package names. So what would the most logical/typical package be? It's the one that matches the directory structure.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne/all,

Just want to flag this as I believe there's a mistake in the 2015 edition of the study guide regarding the answers to this review question.

In the answers to the review questions section for chapter 1, for question 14, the only correct option presented is answer D. I want to challenge this as the explanation given is that Option B is incorrect because "the package names are case-sensitive". In my opinion this must be a misprint as the option with the case-sensitive error would be Option A - which uses a lower case 'a'.

Option D and option B should therefore both be correct as declaring the full package path is not wrong.

The misprint is on page 335 - Appendix A - Answers to Review Questions - Chapter 1: Java Building Blocks  

Please do confirm.

Many thanks,
Joe
 
Dinner will be steamed monkey heads with a side of tiny ads.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic