• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem understanding head first java chapter 9 exercises  RSS feed

 
Nabanita Sarkar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone who understand head first java chapter 9 exercises,explain me ?...please help me out
 
Knute Snortum
Sheriff
Posts: 4276
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post one of the exercises or expand your question so we can know how to answer it without having the book in front of us?
 
Nabanita Sarkar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is one of the exercise:

In this code example, several new objects are created.
Your challenge is to find the object that is 'most popular;
i.e.the one that has the most reference variables referring
to it. Then list how manytotal references there are for
that object, and what they are! We'll start by poi nti ng aut
one of the new objects, and its reference variable.


 
Mike. J. Thompson
Bartender
Posts: 689
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code you have posted won't compile. I haven't analysed the whole thing, but at the very least there is a problem near the for-loop that is creating the bears.

However assuming you correct that code, what do you think the right answer is?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!