title: questions on static import on java
body: <pre><code>import static java.lang.System.out;  
  import java.io.FileNotFoundException;
  import java.io.PrintWriter;
  
  public class ShadowingByImporting
  {
      public static void main(String[] args)throws FileNotFoundException
      {
         out.println("Calling println() in java.lang.System.out");
         PrintWriter pw=new PrintWriter("log.txt");
         writeInfo(pw);
         pw.flush();
         pw.close();
       }
  
      public static void writeInfo(PrintWriter out)    
      {
        out.println("Calling pritnln() in the parameter out");
        System.out.println("Calling println() in java.lang.System.out Example");
      }  
  }
  </code></pre>
  
  <p>The above program is given in Khalid Mugal's SCJP Guide,according to him by the principle of shadowing in static import the second println method  in writeInfo. Method will execute twice, but when I run this following dissimilar output came.</p>
  
  <p>Please somebody explain what's the actual concept.</p>
  
  <pre><code>Calling println() in java.lang.System.out
  
  Calling println() in java.lang.System.out Example
  </code></pre>