A parameter Java method can only return one parameter and use a variable to receive the argument
Printface pfc=new printface ();
int Max=pfc.max ();
Direct call without parameters
Overload
public class HelloWorld {
public static void Main (string[] args) {
Creating objects
HelloWorld Hello = new HelloWorld ();
Calling a method without a parameter
Hello.print ();
Calling a method with a string argument
Hello.print ("King");
Call a method with an integer parameter
Hello.print ("256");
}
public void print () {
SYSTEM.OUT.PRINTLN ("Non-parametric Print method");
}
public void print (String name) {
System.out.println ("Print method with a string argument with the parameter value:" + name);
}
public void print (int age) {
System.out.println ("Print method with an integer parameter with the parameter value:" + age);
}
}
Java parameters without parameters method