How do you call a method in main method in Java?

Call a Method Inside main , call the myMethod() method : public class Main { static void myMethod() { System.out.println(“I just got executed!”); } public static void main(String[] args) { myMethod(); } } // Outputs “I just got executed!”

Sizin İçin Seçtik  What is Observer design?

Leave a Reply

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

How do you call a method in main method in Java?

Call a Method Inside main , call the myMethod() method : public class Main { static void myMethod() { System.out.println(“I just got executed!”); } public static void main(String[] args) { myMethod(); } } // Outputs “I just got executed!”

Sizin İçin Seçtik  ERC20 cüzdanı nedir?

Leave a Reply

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