File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

chapter 3 kb, enums

 
timo corn
Ranch Hand
Posts: 68
MyEclipse IDE PHP Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Raymond Tong
Ranch Hand
Posts: 240
2
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where does the method getBidValue defined ?
 
timo corn
Ranch Hand
Posts: 68
MyEclipse IDE PHP Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this is a fault, must be getVAlue instead of getBidValue..
 
Muhammad Khojaye
Ranch Hand
Posts: 449
IntelliJ IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, there is an error in the book. Change Suits.NOTRUMP.getBidValue(3) to Suits.NOTRUMP.getValue(3)
 
Sidharth Khattri
Ranch Hand
Posts: 125
Java Linux Scala
  • 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic