Re: "Hello world!" without a public class?
Aryeh M. Friedman wrote:
Lew wrote:
Aryeh M. Friedman wrote:
1.) =BBpublic class HelloWorldApp=AB (because this is most common =
IIRC)
This the most common they are going to run into in real life and when y=
ou get in inheritance explain the difference between the 4 options. You s=
hould also point out (I know I will get flamed for this ;-)) that the only =
time you do not want to use "public" is in inner classes (which in my opini=
on should be outlawed anyways)
Do you really mean just inner classes?
Well?
Would you ban all nested classes outright?
It would be a very, very boneheaded thing to outlaw inner classes.
You'd destroy a common idiom for declaring listeners. You'd make lambdas=
impossible. You'd kill one of the most expressive features of Java, that=
was introduced to the language in the first place because of its great=
power.
And get rid of one the most unreadable/widely abused parts of all Java co=
de?
Conclusion not in evidence.
Sounds good to me... almost everything done with inner/nested classes ca=
n be
Which, inner or non-inner nested?
done cleaner with post 1.5 constructs that do not require impossible to r=
ead code.
Show the idioms you have in mind. Show how nested classes are "impossible t=
o
read". They aren't. Unless you don't know Java, in which case don't bother=
arguing about how to improve it. Show that what you have in mind is easier =
to
read. Show how you'd do lambdas without them. For God's sake, provide some=
evidence and logic for your point.
Otherwise it's just your personal, non-engineering-based and utterly irrele=
vant
opinion.
--
Lew