This question already has answers here: Does Java support default parameter values? (24 answers) Closed 6 years ago .

Is it possible to use default argument in the method with String. The code is shown below:

public void test(String name="exampleText") { }

The code above generate error. Is it possible to correct it?