I take on "new" on day 2, when I cover variables.
And static gets revisited several times. I have to be brief with the first class, the main point is that it serves a function, it's not just noise. When we build a class that we use from another class (third or fourth lesson) we use a class method initially, then a non-static method, and get a chance to see the differences in action. This sets us up for static fields in the following class.
Then we talk about how static members relate to classes vs. instantiated objects. Often someone's already encountered the reference from static context problem, so that comes up as an example in the discussion.
Later we go back and look at Hello, World with "new eyes."
At these students' ages a lot of the learning needs to be experience rather than theory.
> At these students' ages a lot of the learning needs to be experience rather than theory.
I think that's true for programming in general regardless of age, unless the person's a genius. I watched a lecture on Skip Lists and totally understood the high-level view, but when it came to implementation it was more challenging than I thought. I likely would have slept through most of my digital electronics course if I didn't know we were doing labs leading to a 4-bit CPU.
>If you leave this out, you'll get an error
This compiles just fine, however at runtime you'll get the error "Exception in thread "main" java.lang.NoSuchMethodError: main" Very nice for a beginner: "I have a main! It's right there! I have two in fact! ..Oh, it wants the args version.">I teach static from a general standpoint of stating belonging to the class rather than an object of that class. For didactic purposes, sometimes you phrase what-ifs in odd ways to get the point across.
That's a lot better, but now I'm curious, do you go over creating Objects and the keyword "new" in the first day as well? How do you describe the difference between object methods and static class methods without an object to demonstrate? If you try to make an object method in your hello world program:
you get a helpful "non-static method hello() cannot be referenced from a static context". Of course you can always do "new t().hello();" but..."static" is a complicated keyword, I'm not convinced that saying "You have to have it, treat it like magic for now but we'll cover what it really means later" isn't a fine enough cop-out for HelloWorld.
Perhaps the correct approach with HTML then is to teach XML that happens to render in a browser first, then go on into what makes HTML special. I'm also not convinced that HTML by itself gets very complicated. Sure, bringing in CSS and JavaScript and then dealing with all the issues of different browsers can get as complicated as a Java HelloWorld program, but that's not exactly HelloWorld material for HTML.
I'll agree that young students can handle a lot more complexity than we give them credit for.