Hi there,
I am new to the forum - (great group BTW!) - and was wondering if someone can clear something up for me. I keep reading that the main() method must be defined as public and static, but when I run a
test with a private or protected main() method, it works. Why is this?
For example, if I create class Test1 as follows:
class Test1
{
private static void main(
String[] args )
{
System.out.println( "private main" );
}
}
And then I run it as
java Test1
I get the "private main" message.
Any thoughts?
Thanks,
Greg