Methods can accept more than one parameter. You separate each parameter with a comma, and each one needs its own type declaration.
public static double average(double a, double b) {
return (a + b) / 2;
}
When calling this method, the arguments must match the parameter list in order. average(10.0, 20.0) assigns to a and to b. Swapping them would not cause an error here, but in methods where parameter order matters (like subtract(a, b)), mixing up the order gives wrong results silently.
There is no hard limit on how many parameters a method can take, but if you find yourself passing more than or , that is a sign the method is doing too much. Consider splitting it into smaller methods.