Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
    Bookmark Topic Watch Topic
  • New Topic

Access Modifier

 
Viswas Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
what is the differnce between public and friendly access modifier?
 
Wilfried LAURENT
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Report post to moderator
There is no friendly access modifier in Java opposite to C++. You have private, protected, public and default (or package).
A default modifier is used like that:

which defines a package protection. All the classes in the package javaranch have access to the titi method.
W.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Report post to moderator
Welcome back to JavaRanch.
You already asked this question here. Take a look at the responses your previous post generated and if you have further questions on the topic, please post them in that thread. We try not to have multiple threads concerning the exact same topic as it quickly becomes difficult to follow the conversation. So, I'm closing this thread.
 
    Bookmark Topic Watch Topic
  • New Topic