|
|
Re: objects in java
|
Posted: Oct 25, 2004 2:13 AM
|
|
I don't understand exactly what you want.
A object is a instace of a class, that's the definition.
If you don't want to create own classes, you can't code anything.
Your example was a executable class, but normally you don't need the main-Method.
static void(some parameters) doesn't make any sense at all.Y ou want to create a constructor? Then you should write public myclass (some parameters) {}
btw: class names and the constructor should be upper case (Myclass), everything else lower case.
If you used BASIC until now: Yes, it IS possible to write spaghetti code in Java, there is way to create classes in the code, but it should be used rarely if there is no other way.
I'm writing on a medium size project, until now I created areound 310 classes.
|
|