Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Does Java 7 introduces a better way to do 'getter/setter'  RSS feed

 
victor fu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I feel the 'getter and setter' in current Java is cumbersome, and other language already has better way to handle that, Does Java 7 has new feature for that? Thanks
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In short no, the properties style syntax that you'll find in Groovy or C# was not accepted for Java 7 (or 8 for that matter). Not necessarily a bad thing mind you (think about how it changes default access behaviour / programming idioms) :-)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!