Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 06 Jan 2013 07:15:51 -0600 From: "Chris Uppal" Newsgroups: comp.lang.java.programmer References: Subject: Re: "Hello world!" without a public class? Date: Sun, 6 Jan 2013 13:09:45 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Message-ID: <-8CdnaTS2P6a5HTNnZ2dnUVZ8vOdnZ2d@bt.com> Lines: 24 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-PVmOh/o2ZGm1vOC+ixUuZdwXka9iqpkNVowaQ95Oqf4VI41m7KAyAXFQ/SR2BvfSZs956waBqc/B9eh!HOZWzPbw5AKYrRDRebnc6gUmhzhOcV+LQjbeOWF3UQYPaHu2jvP8QWqo+BtadPn0VE9pYh4+a/0= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2250 Xref: csiph.com comp.lang.java.programmer:21020 Stefan Ram wrote: > There is no »public« in front of »class« in Oracles Tutorial! > > What should I teach in my classes? I don't have a strong opinion on how the class should be declared, but I do think -- and very strongly -- that the Java entry-point convention is a massive kludge, highly non-representative of how any sane OO code would be written, and not at all an example to be followed. As such, I think it would benefit your students if you made that very clear to them from the start (yes, there is a risk of confusion, but no student will be confused who wouldn't otherwise probably be mislead -- which is worse). FWIW: the examples in the JLS3 all use an default access class to house the (specified to be required) public static void main(String args...) or public static void main(String[] args) entry-point. The spec does not appear to care what access the class itself has (and there's no obvious reason -- technical or semantic -- why it should). Does "private" work ? If so then using that would be defensible. -- chris