How to Call a Method Multiple Times in Java


In this example, we will learn the method to call a method multiple times in Java.

Source Code

package com.beginner.examples;

public class MultipleCall {
  static void test() {
    System.out.println("test");
  }

  public static void main(String[] args) {
    // call a method multiple times
    test();
    test();
    test();
  }
}

Output:

test
test
test
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments