Rename Method Parameter Name

I defined the interface:

public Interface A { foo(String criteria) } 

Can I rename a parameter name in an implementation class?

 final public B implements A { foo(String name) } 

Thanks!

+4
source share
3 answers

You can definitely rename a variable name; it is not part of the signature.

A method signature includes its return type, method name, and the type and order of its parameters.

+1
source

Sure. The name of the variable (parameter) is not part of the method signature.

+8
source

Yes, the parameter name is not part of the interface.

+1
source

All Articles