Randy said:
I'm an intermediate/advanced level programmer taking a 200 level intro
java course, but I am having an extremely difficult time with what
could be a very simple problem. The following program, should write
"hello world" to the console when it is run:
public class HelloWorld {
public void main(String[] args) {
System.out.println("hello world");
}
}
however, it's not, and I'm wasting valuable hours trying to figure out
why the anal java vm doesn't like it. My prof claimed that java was a
flexible and powerful language, but personally, I'm not getting that
impression so far (at least as far as flexibility goes)...
note: a speedy response (aka, before 9:00 am EST monday morning) would
be appreciated.
Others have already commented on the problem with your code,
but I have additional comments on what you asked and the way
you asked it. Use, ignore or discard as you wish, but it may
come in handy the next time you need to ask a question.
Someone once wrote an article called "How to ask questions the
smart way," (see bottom) in which he described common mistakes
people make when posting on Usenet looking for help, and
explained why those were mistakes. Your post committed a good
number of them:
-- If you're an advanced programmer (even though you qualified
it as "intermediate/advanced") you should be able to work through
getting a "hello world" program working, in pretty much any
language, on pretty much any system. If you can't, it's an
important skill to acquire, but you're dismissing it as a "waste
of valuable time." As a sometimes university instructor myself,
I care more that my students acquire problem solving skills than
I care about their understanding of the syntactic idiosyncrasies
of a particular language, because with the former you can work
through the latter. So on the contrary, it's not a waste of
time, it's probably the most valuable way you CAN spend your
time. And even if it is a waste of time, you can't learn the
language without learning what the compiler expects. (Besides,
many readers, when seeing you describe yourself as advanced and
seeing what problem you're having, will conclude that you're
probably full of yourself.)
-- Cardinal mistake: "This doesn't work" without any indication
of what it IS doing and what you've tried. The commands you
ran, the error messages you got, SOMETHING so people don't have
to read your mind....
-- What you wrote: "I'm wasting valuable hours trying to figure
out why the anal java vm doesn't like it." What people read:
"I want you to use YOUR time solving my problem (for free)
because my time is more valuable than yours. Oh, and it's not
MY fault, it's the COMPILER'S fault for being too anal."
-- "My prof claimed that java was a flexible and powerful
language, but personally, I'm not getting that impression so
far (at least as far as flexibility goes)..." Umm, I think
Java's flexibility is related to factors other than how easy
it is to get a "hello world" program working for someone who
doesn't want to take the time to learn the language.
-- What you wrote: "a speedy response (aka, before 9:00 am
EST monday morning) would be appreciated." How that's read:
"Not only do I want you to use your time (as I said, mine's
too valuable), but I want you to do it on MY schedule too."
And frankly, a student's concept of urgency is likely to
differ from others' concept of urgency. Will lives, jobs
and/or millions of dollars be lost if you don't have an
answer by 9:00 AM Monday? For some people who may be
reading your post, that's what urgency means.
Sorry if this comes off as hostle or arrogant. You can read
the full article here:
http://www.catb.org/~esr/faqs/smart-questions.html