I defined an interface:
public Interface A
{
foo(String criteria)
}
Can I rename the parameter name in the implementing class?
final public B implements A
{
foo(String name)
}
Thanks!
Sure you can. The variable (parameter) name is not part of the method signature.
是的,参数名称不是界面的一部分。
You definitely can rename the variable name, it is not a part of the signature.
The signature of a method includes its return type, the method name, and the type and order of its parameters.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.