The moose likes OO, Patterns, UML and Refactoring and the fly likes Where exactly should we use protected classes? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Reply Bookmark "Where exactly should we use protected classes?" Watch "Where exactly should we use protected classes?" New topic
Author

Where exactly should we use protected classes?

Kunaal A Trehan
Ranch Hand

Joined: Feb 04, 2004
Posts: 63
Can some one explain me when exactly we shd go for the protected classes?
A use case will help me alot

Rgds
Kunal
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 23242

Inner classes can be "protected" but top-level classes can't. Are you talking about protected inner classes, or are you simply talking about non-public classes?

In any case, this is the sort of question entertained in our OO, Patterns, UML, and Refactoring" forum. I'll move this post there for you.


[Jess in Action][AskingGoodQuestions]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
I don't think I've ever used a protected class of any kind. My guess is that it exists more for reasons of language consistency and less for reasons of actual *need*.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
 
subject: Where exactly should we use protected classes?
 
developer file tools