p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Java Basics (http://p2p.wrox.com/forumdisplay.php?f=199)
-   -   disadvantages of protected access specifier (http://p2p.wrox.com/showthread.php?t=46030)

kishore.dyn August 2nd, 2006 07:22 AM

disadvantages of protected access specifier
What are the disadvantages of Protected access specifier in java?

k.ram kishore

panacea August 7th, 2006 08:30 PM

Bhavesh, what you describe is the default access modifier (when you don't specify public, private, or protected). Protected acts as public within the class and its subclasses, but is hidden outside of those two cases. I'd say the disadvantage to protected is that people can subclass your class and create public getters/setters for it, therefore removing the intention of the access modifier.

Jon Emerson

panacea August 10th, 2006 03:31 PM

Great, Bhavesh deleted his reply. How nice of him.

Jon Emerson

All times are GMT -4. The time now is 06:04 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.