title: What Exactly is a Client of a Class
body: <p>I always thought a client of a class is one that uses a reference to access instance fields/methods of that class i.e. another class (from its own methods). But when I think about some details there are some things that I couldn't figure out.</p>
  
  <p>In Java I know of a few places where you can place action statements.</p>
  
  <ul>
  <li>Inside a method (instance/static)</li>
  <li>Inline initialization (when you declare an instance variable like in
  private int x = 5;)</li>
  <li>Static block</li>
  </ul>
  
  <p>Maybe there are more that I don't know or remember.</p>
  
  <p><strong>The first part of the question is</strong> are all of these considered clients if they are in another class? Also can they access private stuff when they are in the same class?</p>
  
  <p><strong>The second part is:</strong> When JVM calls a method (like main and finalize) are they considered clients, too? (the calls are not from a class?)</p>
  
  <p><strong>Edit:</strong> Can a client access only public methods and variables? Can't we call it a client if it accesses package fields (if in the same package).</p>