• 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

Method names

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi friends,

I have just started studying K&B book .It says,

public void modifyMyValue() is invalid way of declaring method.'modify' should not be used.

Please help me understand whats wrong in above declaration


thanks
ashni
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ashni Prakash,

Can you please mention the page number in K&B book.

I tried to write a program having a mmethod named as modifyMyValue() and I didnt get any errors.
 
Ranch Hand
Posts: 159
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What they probably mean is that it is not a right name according to bean specs.
If the method is setting a value and the var is e.g. myVar, then the method should be called 'setMyVar' not modifyMyValue or whatever else.
This has nothing to do with compilation...
 
ashni Prakash
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you marc for the explaination.

Vatsalya its chapter 1 and page 10
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic