wood burning stoves 2.0*
The moose likes Java in General and the fly likes Why we can't declare private and protected as access specifiers for a class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Why we can't declare private and protected as access specifiers for a class

Ramesh Pappala
Ranch Hand

Joined: Sep 14, 2005
Posts: 50
Why we can't use private and protected as access specifiers for a class.
Could you give me an example.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

Because you can't. Why can't a variable be declared as both "int" and "double?" Same reason: because it can't.

Please don't start new threads to ask follow-on questions from other threads -- we already discussed this here. I'm going to close this thread; followups in the original thread, please.


[Jess in Action][AskingGoodQuestions]
 
wood burning stoves
 
subject: Why we can't declare private and protected as access specifiers for a class
 
Similar Threads
Inner classes and inheritance
Accessibility Modifiers for classes
about access specifiers
enum public/protected/default/private
AccessModifiers and Access Specifiers