This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Access Modifier Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Access Modifier

Viswas Kumar
Greenhorn

Joined: Sep 29, 2002
Posts: 4
what is the differnce between public and friendly access modifier?


viswas
Wilfried LAURENT
Ranch Hand

Joined: Jul 13, 2001
Posts: 269
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

Joined: Dec 10, 2001
Posts: 7023
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.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
jQuery in Action, 2nd edition
 
subject: Access Modifier
 
Similar Threads
Overriden Method Query
basic question on access modifiers and levels
access specifier and access modifier
Constructors
Access specifiers & Access Modifiers