Java Best Practice Programming Practices

Tutorials Shared by the Internet Community



Java Best Practice Programming Practices


  • Total Hits - 27185

  • Total Votes - 7 votes

  • Vote Up - 4 votes

  • Vote Down - 3 votes

  • Domain -

  • Category - JAVA/Core JAVA

  • Submitted By - Appu T

  • Submitted on - 2014-03-16 09:49:08


Providing Access to Instance and Class Variables Don’t make any instance or class variable public without good reason. Often, instance variables don’t need to be explicitly set or gotten—often that happens as a side effect of method calls.One example of appropriate public instance variables is the case where the class is essentially a data structure, with no behavior. In other words, if you would have used a struct instead of a class (if Java supported struct), then it’s appropriate to make the class’s instance variables public.Referring... - See more at: ...

Site  |   Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down