View Single Post
Unread 7 Nov 2006, 00:00   #8
Phil^
Insomniac
 
Phil^'s Avatar
 
Join Date: May 2003
Posts: 3,583
Phil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus would
Re: [Java] Recommendations

the example structures utilise object orientated programming to its fullest. The example code you have given is procedural programming, and in java its a bit of a no-no.
Ask your tutor if you will be going into object orientated programming in java, and polymorphism.
if you are not - your tutor is unbelievably crap and i suggest you learn it on your own
to get out of the static context in the example above, use :
Code:
class rtv2
{
    public static void main (String[] param)
    {
        rtv2 program = new rtv2();
        program.go();

    }
    public void go()
    {
    // this function replaces everything you would ordinarily put in main. If you need args rememebr to pass them
    reality2();
    }

    public void reality2 ()
    {
// ------------- program goes in here ------------
    }
Note since you have created an object of rtv2, you can refer to it by the object name to call public functions in it
you can also create multiple objects and run that method in all of them too
__________________
Phil^
Phil^ is offline   Reply With Quote