Sometimes it is used in order to distinguish class members from local variables:
public class MyClass {
private int _salary;
public MyClass(int salary) {
_salary = salary
}
}
However, you should follow Java Naming Conventions that doesn’t recommend using that. You can simply name the class member without the leading _ and do:
this.salary = salary;