far*_*ich 2 java methods static naming-conventions
对于Java中的静态方法,该参数不能与全局静态变量同名.是否有命名参数的约定?......只是一种好奇心.
private static volatile int metBetYetPetLetJet = 8675309;
public static void setMetBetYetPetLetJet (int metBetYetPetLetJet0) {
metBetYetPetLetJet = metBetYetPetLetJet0;
}
参数绝对可以具有相同的名称:
public class Foo {
private static volatile int metBetYetPetLetJet = 8675309
public static void setMetBetYetPetLetJet (int metBetYetPetLetJet) {
Foo.metBetYetPetLetJet = metBetYetPetLetJet;
}
}
Run Code Online (Sandbox Code Playgroud)
或者,我经常只使用valuesetter的参数名称.这可能是C#的影响虽然:)另一种选择是newValue.