Shadowing fields with a local variable or with a method parameter is a bad practice reducing code readability: It makes it confusing to know whether the field or the variable is and should be accessed.
class Foo {
public int myField;
public void doSomething() {
int myField = 0;
...
}
public void doSomethingElse(int myField) {
...
}
}
Constructors and setters are exceptions; it is common practice to name arguments for the fields the values will be assigned to. Static methods are also excepted.
class Foo {
public int myField;
public Foo(int myField) {
this.myField = myField;
}
public static Foo build(int myField) {
...
}
public void setMyField(int myField){
this.myField = myField;
}
}