This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question 7 of chapter 3

 
Raymond Chamberglain
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am completely confused with this question. Where in the world is the getBidValue(3) method (line 11)? Also some things I want to clarify some things. One of the answers say 'The output could contain @bf73fa'. What is that number? Is it the bit representation of an array object? Then Suits.SPADES.points can be accessed? So private members can be accessed by anything within the class, am I correct? Thank you for the help!!

 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where in the world is the getBidValue(3) method (line 11)?

Looks like a typo to me where they're mixing getValue with getBidValue.

One of the answers say 'The output could contain @bf73fa'. What is that number?

That's that is the result of a toString call to the array. Better would be something like:

or a for-loop

Then Suits.SPADES.points can be accessed? So private members can be accessed by anything within the class, am I correct?

Yes they can, and since main is held within the class then private variables are accessible to the main method. Another perhaps more important question is: should main try to access this directly?
 
Raymond Chamberglain
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So '@bf73fa' is a String representation to the array element?
 
Raymond Chamberglain
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry. The source is the 'Sun Certified Programmer for Java 6 Study Guide' by Kathy Sierra and Bert Bates.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raymond Chamberglain wrote:So '@bf73fa' is a String representation to the array element?

It can be part of a representation of any object that does not have a to String override. Array's usually begin with this character "[" then a class name, then a String similar to yours above.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic