It would probably be helpful if you started out describing some of the basic features and terminology of java before jumping right into a program. The program might not be that hard to jump into if you are familiar with c++ and objects, but it is the kind of thing that if you haven't seen before, this could kind of blow people's minds.
I would suggest starting off describing the object oriented model. Descriping how it can take on characteristics of a real object and how objects can interact. One of the best ways I have seen this described is to right a sentence about something you want your program to do, the nouns can be your objects, the verbs/adverbs your methods. Once you get that out, I would recommend, then discussing how java is entirely object oriented, how everything in java is an object and that there are several 'sub-objects' that inherit properties of lower level objects and then expand upon them (and then in turn are inherited). This would go a long way to explaining why there is a system object and why it is used for outputing, why you are using string objects, etc.
Once you have all that down, then I would jump into a sample program like you did and demonstrate how the objects interact. Once you have down the fundamental idea of java being object oriented and basically centered around object interaction, the rest is basically learning syntax (which is very very similar to c++)...
Damn, couple of corrections, expanding of what I was saying (I tried to get this out too quick). 'described is to right' --> 'described is to write'
Also when I was discussing object interactions and inheriting object properties, and how there can be multiple levels of object property inheritance and how this leads to things in your code like System.out.println, where you are accessing the println method in the out object in the system object (or something to that effect, sorry been a few years since I used java). The other thing that I was getting at in the discussion of everything being object oriented that I left off is that java ITSELF is entirely object oriented, that every operator and data type and method is defined within various objects (ie., system.out.println) and that is why it is so critical to fully understand object oriented programming to properly understand java...
September 23rd, 2002, 08:45 PM
I will be posting my own Java Tutorial (my first tutorial) within the next day or so. Keep your eyes open.
September 8th, 2003, 10:52 PM
Thanks this is extreamly helpful. Thanks for taking the time to write it.
September 8th, 2003, 10:57 PM
after i put it in a text file what would i name the extention?
September 8th, 2003, 11:48 PM
All java source files must have the .java extension in order to be compiled.
September 9th, 2003, 12:05 AM
I apologize but I code, but am a newbie to Java. I read a lot of tutorials and such, but I still do not understand it. On the otherhand I can understand it perfectly if somebody taught me the bare basics I can pick up everything else real quick. Is that a problem for other people, and if so how did you rectify it? Thanks for the tutorials, even if they did not stick with me. The effort is and will be appreciated by many.
April 11th, 2005, 02:20 AM
It's cool to see some newbies writing some tutorials on here. I'm pretty much new at programming as well, just started making GUIs in Java. Have you tried using JDK 1.5 yet? I've been seeing fewer people using System.out.println(); or System.out.print(); Lately, I've been seeing them use System.out.printf(); I normally stick with the old method, but this new method make concatination (spelling) simplier.
Also, have you all tried using JGrasp yet? I started using it and it seems pretty cool, but I've ran into a few instances when I was completely fooled into remembering to save my work.
For those of you who haven't used it, you can compile and run your program without saving. I've also ran into some problems where the changes weren't completely made and JGrasp didn't register them. I sucked big time. My program worked, but I guess JGrasp didn't see enough in the original program to make the change to the class file.