how to call a function in java

104

how to call a function in java -

public class MyClass {
 
    static void myMethod() {
        System.out.println("You have called me! My name is: myMethod!");
    }
 
    public static void main(String[] args) {
        myMethod();
    }
}

Comments

Submit
0 Comments