aspose file tools*
The moose likes Beginning Java and the fly likes Will access Modifiers in java enhance the application performance? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Will access Modifiers in java enhance the application performance?" Watch "Will access Modifiers in java enhance the application performance?" New topic
Author

Will access Modifiers in java enhance the application performance?

sriram sundararajan
Ranch Hand

Joined: Apr 08, 2003
Posts: 43
Hi All,
Access modifiers can restrict the usages of methods and variables within an application. Using this effectively, is considered as a good coding practice or will i be benefited anything from performance wise.

Say i am having a public method in my class, but i am using that method only in that class. If i change this method to private, will it improve my performance?

Similarly if i mark my class as final, no body can extend that, but will it improve the performance?

regards
sriram.
W. Joe Smith
Ranch Hand

Joined: Feb 10, 2009
Posts: 710
I don't think your application will run any faster or more efficiently, but using proper access modifiers makes your code more secure which is always a good thing.


SCJA
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Will access Modifiers in java enhance the application performance?