java - Multiple parameters for a single method -
i don't know how simple or if possible can't seem find information on it. method there way set multiple parameters.
for example in public void required call component , and string when call method in java file.
public void testmethod(component c, string s) { //do }
is there way public void testmethod(component c, string d)
or public void testmethod(component c, int i)
, when method called either specified?
it's called method overloading. create them separate methods , compiler (usually) infer right 1 based on input values.
Comments
Post a Comment