How do you call a main method from another method?

public static void main (String[ ] args) aka the main method can be called from an another method or a class outside of main. You just have to call it using: main(null); As long as you have declared your main method as public you can call it.

Sizin İçin Seçtik  What are built in Java classes?

Leave a Reply

Your email address will not be published. Required fields are marked *