This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma 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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

Access Modifier

Viswas Kumar

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

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.
Dirk Schreckmann

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]
I agree. Here's the link:
subject: Access Modifier
It's not a secret anymore!