How to Implement Method with Parameters in Java


In this example we will show the method to implement method with parameters in Java.

Source Code

package com.beginner.examples;

public class Method {
  static void test(int a) { // method with parameters
    System.out.println(a);
  }

  public static void main(String[] args) {
    test(1);
  }
}

Output:

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