This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
why public for main
- From: "amroz kamal siddiqui" <kamalamroz at rediffmail dot com>
- To: java at gcc dot gnu dot org
- Date: 5 Apr 2003 16:53:07 -0000
- Subject: why public for main
- Reply-to: "amroz kamal siddiqui" <kamalamroz at rediffmail dot com>
hello friends out there,
Iam a newbie in java, I just have a simple and a
very
annoying ( at least to me ) question. Why do we use the keyword
public for the main method ?
eg.
public static void main(String arg[])
Actually the problem is that, it works even if I don't use
public.
In fact it works if I use private like
private static void main(String arg[])
only removing static does not work.
Thus,
all the following works,
public static void main(String arg[])
private static void main(String arg[])
static void main(String arg[])
but the following does not work,
void main(String arg[])
################ WHY #####################
please help
Amroz
Siddiqui Amroz Kamal
_______________________________________________________________________
Odomos - the only mosquito protection outside 4 walls -
Click here to know more!
http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htm&&odomos&&wn