<p>In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), <code>public</code>, <code>protected</code> and <code>private</code>, while making <code>class</code> and <code>interface</code> and dealing with inheritance?</p>

The official tutorial
may be of some use to you.
Class
Package
Subclass
(same pkg)
Subclass
(diff pkg)
World
```
public
```
+
+
+
+
+
```
protected
```
+
+
+
+
no modifier
+
+
+
```
private
```
+
+ : accessible
blank : not accessible