We've recently got some java lessons and there's one thing I don't get. Why do you stuff the main method into a class that's got nothing to do with it? It does not even have access to the classes methods and functions, it has to create an object of the class it's in. WHY?
Who fails? The teacher, java or me?
Name:
Anonymous2007-04-07 4:30 ID:lEXmWXEX
Someone translate from fragmented English to readable, please.
Main goes into a class, and that's bad? Does it make a difference?
I don't know what you mean about it not having access to the classes' methods and functions. It can use all public methods of another class.
And I don't know what you mean by "it has to create an object of the class it's in", that makes no sense. Main is static, it doesn't need to be created. You can make static methods in other classes, too, so you don't need to create instances of the class to access them.