GeeCON Prague 2014*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes chapter 3 kb, enums Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "chapter 3 kb, enums" Watch "chapter 3 kb, enums" New topic
Author

chapter 3 kb, enums

timo corn
Ranch Hand

Joined: Oct 26, 2013
Posts: 68

I am stuck with p. 281 with the following code:

Can you explain the diff. between getValue on line 6 and getValue on line 9? Line 9 includes the instance variable points. Which will be called on line 12 (there is an error, must be getValue)


hth
Raymond Tong
Ranch Hand

Joined: Aug 15, 2010
Posts: 230
    
    2

where does the method getBidValue defined ?
timo corn
Ranch Hand

Joined: Oct 26, 2013
Posts: 68

I think this is a fault, must be getVAlue instead of getBidValue..
Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

Yes, there is an error in the book. Change Suits.NOTRUMP.getBidValue(3) to Suits.NOTRUMP.getValue(3)


http://muhammadkhojaye.blogspot.com/
Sidharth Khattri
Ranch Hand

Joined: Sep 16, 2013
Posts: 121

When you'll give a call:

then the getValue method at line 6 will be called, and
When you'll give a call to getValue on any other enum variables,
then the getValue method at line 9 will be called.

getValue method at line 6 basically overrides the one at line 9 only for enum variable NOTRUMP.


OCPJP 6 - 96%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: chapter 3 kb, enums