Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
| Search | Today's Posts | Mark Forums Read
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 2nd, 2006, 07:22 AM
Registered User
 
Join Date: Feb 2006
Location: bangalore, karnataka, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default disadvantages of protected access specifier

What are the disadvantages of Protected access specifier in java?

k.ram kishore
  #2 (permalink)  
Old August 7th, 2006, 08:30 PM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
http://www.jonemerson.net/
  #3 (permalink)  
Old August 10th, 2006, 03:31 PM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Jon Emerson
http://www.jonemerson.net/


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report 9 password protected mdb ACCESS sajid_rauf Pro VB Databases 2 July 27th, 2007 02:29 AM
Between And Specifier David Coulter Access VBA 9 July 19th, 2007 07:07 AM
sub report in a password protected access database aasheesh_jha Crystal Reports 0 January 2nd, 2007 07:09 PM
Protected access wourouds BOOK: Beginning Java 2 4 March 18th, 2004 03:27 AM
Access and embedding Password Protected Documents dkb Access 4 January 16th, 2004 09:11 AM





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