Answers for "java call other main"

1

java run main of another class

public class CallClass{

    public void call(){
       ToBeCalledClass.main(null); //or whatever args you want
    }
}
Posted by: Guest on March-25-2021
0

can i call another function from main hava

package learningjava;

public class helloworld {
    public static void main(String[] args) {
        new helloworld().go();
        // OR
        helloworld.get();
    }

    public void go(){
        System.out.println("Hello World");
    }
    public static void get(){
        System.out.println("Hello World, Again");
    }
}
Posted by: Guest on October-21-2020

Code answers related to "java call other main"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language