title: Base class & derived class in a package
body: <p>When I create the base and derived class in the same directory without specifying any package they compile fine, but adding them to a package leads to an error in derived class saying that it is not able find he symbol of base class. This error is frustrating since I have been working in c before , why all these shenanigans in Java?.</p>
  
  <pre><code>package Testpackage; // If I comment this then derived class compiles fine
  
  public class Test_class{
  
      int x,y;
  
  
      public static Integer angle;
  
  
      public Test_class(int a,int b)
  {
      x = a;
          y = b;
  }
  
  
      public Integer product()
  {
      return x*y;
  }
  }
  
  *************Derived class ****************
  package Testpackage;  // If I comment this then it compiles fine
  
  public class Derived_class extends Test_class{
  
         Integer vol;
        Test_class I = new Test_class(1,2); 
          public Derived_class(){
            super(9,10);
        vol = 0;
     }
  
         public Integer volume()
     {
           vol = this.product();
  
           return vol;
     }
  
  }
  
  
  ********* output *************
  assa@dasman-laptop:~/Testpackage$ javac Derived_class.java 
  Derived_class.java:4: cannot find symbol
  symbol: class Test_class
  public class Derived_class extends Test_class{
                                     ^
  Derived_class.java:7: cannot find symbol
  symbol  : class Test_class
  location: class Testpackage.Derived_class
            Test_class I = new Test_class(1,2); 
            ^
  Derived_class.java:7: cannot find symbol
  symbol  : class Test_class
  location: class Testpackage.Derived_class
            Test_class I = new Test_class(1,2); 
                               ^
  Derived_class.java:15: cannot find symbol
  symbol  : method product()
  location: class Testpackage.Derived_class
               vol = this.product();
  </code></pre>