Consider the following four class declarations.
Note that Q, R and S are all in package P,
but T and U are not.
//---------------------------- | //----------------------------
package P; | package P;
public class Q | public class R extends Q {...}
{ | //----------------------------
public int f; | package P;
private int g; | public class S {...}
protected int h; | //----------------------------
int i; | public class T extends Q {...}
} | //----------------------------
//--------------------------- | public class U {...}
| //----------------------------
- List all classes that can access variable f.
Q, R, S, T, U
- List all classes that can access variable g.
Q
- List all classes that can access variable h.
Q, R, S, T
- List all classes that can access variable i.
Q, R, S