• Post Reply Bookmark Topic Watch Topic
  • New Topic

about access specifiers  RSS feed

 
Santhi Bharath
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why can't we give private and protected specifiers for a class
while i am trying to give the specifires i got an error?

can any body explain me why ? thanks in advance
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That comes up quite frequently. Look at this thread. I can't seem to find any more useful threads. Please ask again if you don't understand.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15865
81
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Access control keywords such as "protected" and "private" are for class members only. Top-level classes are not members of any class.

Suppose you could make a top-level class private, then what is that supposed to mean?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!