title: why class define in other package can not implement interface or extends class define in default package in java
body: <p>Below interface define in default package  </p>
  
  <pre><code>public interface Foo{  
  }  
  </code></pre>
  
  <hr>
  
  <pre><code>package com.code  
  public class  MyClass implements Foo{  
  }
  </code></pre>
  
  <hr>
  
  <p>Above code will give following  compilation error:<br>
  Foo can not be resolved to type<br>
  why???</p>