wrote:
> Hi All ,
>
> I have the following query :-
>
> If I define the main method as a Private ,
private, it doesn't have a capital letter.
> then run the demo program
> the program obviously doesnt run ,we have a runtime error .What
> exactly is the reason behind it .
Because a private method is only visible in the class in which it is defined. So
a private main() method is not visible to the JVM so it cannot invoke it.
>
> I know its not a good programming practice and the main should always
> be in Public.
It's not that it's bad programming practice, it just won't work.
> But I want a conceptual answer as to why its not a valid thing to make
> the main as Private.
> Any help would be highly appreciated .
>
> Regards,
> Abhishek.
--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail :
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555