wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes question 7 of chapter 3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "question 7 of chapter 3" Watch "question 7 of chapter 3" New topic
Author

question 7 of chapter 3

Raymond Chamberglain
Greenhorn

Joined: Jun 14, 2009
Posts: 8
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

Joined: Feb 23, 2007
Posts: 1561
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

Joined: Jun 14, 2009
Posts: 8
So '@bf73fa' is a String representation to the array element?
Raymond Chamberglain
Greenhorn

Joined: Jun 14, 2009
Posts: 8
I'm sorry. The source is the 'Sun Certified Programmer for Java 6 Study Guide' by Kathy Sierra and Bert Bates.
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: question 7 of chapter 3
 
Similar Threads
Sun Ceritified Programmer for Java 6 Study Guide chapter-3 & question-7
Enum clarification
Should it not give compile time error?
K & B, Chapter 3, Quiz Question 7
K&B Chapter 3 Question 7