• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about access specifiers

 
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
Pie
Posts: 49849
70
  • 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
Saloon Keeper
Posts: 15452
42
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic