How do I use optional parameters in Java? What specification supports optional parameters?
You can do thing using method overloading like this.
public void load(String name){ }
public void load(String name,int age){}
Also you can use @Nullable annotation
public void load(@Nullable String name,int age){}
simply pass null as first parameter.
If you are passing same type variable you can use this
public void load(String name...){}