Also, here is a link that discusses more about restricting access. Remember there are two types you didnt mention: protected and no modifier at all which is called "package protected".
http://java.sun.com/docs/b
Main Topics
Browse All TopicsPlease tell why main, declared to be private is still working properly. If it is all right to use it that way then when and where should we use public and where should private be used.
class Test12
{
private static void main(String s[])
{
System.out.println("This fe");
}
}
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Also, here is a link that discusses more about restricting access. Remember there are two types you didnt mention: protected and no modifier at all which is called "package protected".
http://java.sun.com/docs/b
just checked it with jdk1.2.2 and jdk1.3, it worked on both.
its a known bug, that will not be fixed :
http://developer.java.sun.
Business Accounts
Answer for Membership
by: rkenworthyPosted on 2001-03-13 at 20:29:07ID: 5926902
Straight from sun's java tutorial at http://java.sun.com/docs/b ooks/tutor ial/getSta rted/ appli cation/mai n.html
Every Java application must contain a main method whose signature looks like this:
public static void main(String[] args)
The method signature for the main method contains three modifiers:
public indicates that the main method can be called by any object. Controlling Access to Members of a Class covers the ins and outs of the access modifiers supported by the Java language.
static indicates that the main method is a class method. Understanding Instance and Class Members talks about class methods and variables.
void indicates that the main method doesn't return any value.