• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

question 7 of chapter 3

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!

 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic