What is the best practice...
Assume there is a class hierachy like
Person (Super class) / StaffMember/ Professor (Sub class)

1) The best way is to keep all the instance variables of each and every class private and access the private variables of super classes through subclass constructors (calling "super()")

Ex:-

public class Person {
private String empNo;

public Person (String empNo) {
this.empNo = empNo;
}
}

public class Professor extends Person {
private String ........;
private int ...........;

public Professor (String pEmpNo) {
super(pEmpNo);
}
}

OR

2)Changing the access level of the super class variables into "protected" or "default" and access them directly within the sub classes...

Ex:-

public class Person {
protected String empNo;

public Person () {

}
}

public class Professor extends Person {
String ........;
int ...........;

public Professor (String empNo) {
this.empNo = empNo;
..............
..............
}
}

Thank you...