title: Java default class access of package-private works like public
body: <p>As stated in many places,  a  class yields a package-private access level, which means such a class can only be accessed by others is the same package. I don't know many things about packages, but I suppose knowing you add "package x" at the start of a file is enough knowledge to pose my question.</p>
  
  <p>I've made a file with a class ingredient. Another file contains</p>
  
  <pre><code>public class cooking{ 
      public static void main(String[] args) {.....
  </code></pre>
  
  <p>There's no package declaration anywhere. Still, my program compiles the two files successfully, and also runs so. What am I missing? Shouldn't the cooking class NOT be able to see ingredient?</p>