• Post Reply Bookmark Topic Watch Topic
  • New Topic

Access Specifier  RSS feed

 
Vineela Devi
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have come across the access specifier privateprotected in some book.Is this access specifier deprecated in java 1.4? can anyone please explain about this in detail?
 
Timmy Marks
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never heard of an access modifier called privateprotected. It could be a reference to the default access when none is given. It lies between private and protected in terms of who can access the resource. Otherwise known as "friendly" or "package" scope.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Long, long, long ago, before the JDK 1.0.2 release that was most people's first exposure to Java, things were a little different.
  • Catch blocks didn't need to have braces around their bodies! People actually complained when a change was made to require them.
  • There was a substantially different java.applet package. I don't actually remember the details except that it was more complicated. I believe the book "Hooked on Java," which was an awful book but which sold well because it was the very first Java book published, describes this API; by the time the book came out, though, the new API was already in place!
  • There was an access level, "private protected," which was exactly like C++'s "protected." It restricted access to subclasses only. It was removed because it apparently wrecked havoc with Java's security model, where these protection levels must be enforced at runtime as well as at compile time.


  • Some other old-timers might want to add things to this list if they can think of them.
    In any event, if you've got a book that says there's a "private protected" level, then it's an old, old, old book and I wouldn't use it for anything!
    [ January 16, 2004: Message edited by: Ernest Friedman-Hill ]
     
    Dirk Schreckmann
    Sheriff
    Posts: 7023
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    In any event, if you've got a book that says there's a "private protected" level, then it's an old, old, old book and I wouldn't use it for anything!
    The sad thing is that I once read a book, which included and explained this modifier, that was published in 2001. To protect the authors, I won't mention the title of the book.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!