Starting class.

Heyi just wanna know how i can start a *.class from the main.class in netbeans thx.Martin
[110 byte] By [-Martin-a] at [2007-11-26 18:02:22]
# 1

what does "start a class" mean? if you mean "invoke the main method" like the JVM would, simply call the main method like any other method:

// class 1

public class DoStuff {

//methods, whatever

public static void main(String[] args) {

// stuff

// things

}

}

...

// class 2

public class DoOtherStuff {

public void invokeAnotherClassesMain() {

DoStuff.main(null);

}

}

but if you're needing to do that in order to get things done, you've probably got design issues

georgemca at 2007-7-9 5:32:14 > top of Java-index,Java Essentials,New To Java...
# 2
i have 1 *.java files under javaapp.1 i just wanna connect them so that i start mysql.java from main.java
-Martin-a at 2007-7-9 5:32:14 > top of Java-index,Java Essentials,New To Java...
# 3
what does "start" the class mean? there isn't such a concept, you merely instantiate what needs to be instantiated and invoke what needs to be invoked
georgemca at 2007-7-9 5:32:14 > top of Java-index,Java Essentials,New To Java...
# 4
note to pedants: yes, one could argue that loading a class, and running the static initializer could be termed "starting" a class. that's not what this poster is asking about, and therefore a red herring
georgemca at 2007-7-9 5:32:14 > top of Java-index,Java Essentials,New To Java...