Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

question 7 of chapter 3  RSS feed

 
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!!

 
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.
 
Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!