This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about Twist in the Tale 1.2 (Mala Gupta)

 
alan white
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a question regarding Mala Gupta's book. In section 1 - A twist in the tale 1.2 we are asked
to choose which answers are correct.

One of the answers given as correct is:
Changing the class Car to a non-public class will compile the code.

I have tried this but it still won't compile. I've tried looking for the book errata given in another answer
but can't find it in the link provided.

The code is:

Any suggestions

Alan

 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35976
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alan,
Welcome to CodeRanch! I've added [ code ] tags to make your post easier to read.

In the code in the book*, this isn't included:


* I'm looking at an older version of the book since I tech proofread it. Can you double check to see if that code really is there? (And if it is, remove it as it shouldn't be.)

That's why your code doesn't compile. Multiple2 is defined twice by mistake.
 
Roel De Nijs
Sheriff
Posts: 10763
148
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just had a look to the Twist in the Tale 1.2 of Mala Gupta's book.

This is the provided code snippet for this exercise:

So if you start from the above code and you change the Car class a to a non-public class, the code will definitely compile.

Hope it helps!
Kind regards,
Roel
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!