title: array of objects as they relate Interfaces and abstract classes
body: <p>So I have been pulling my hair out trying to understand how to call methods on objects in an array.  The gist of this homework is to create a comparable interface from scratch, an abstract class called "Weapon", an interface called "Drawable", a couple classes that extend Weapon, and a "Spaceship" class that creates a spaceship with an array of weapon objects.</p>
  
  <p>The following is the code for the "Spaceship" class. The error "not a statement" occures at line 40. The intended purpose of the fireFastestWeapon method is to sort the object array based on each objects fire time, and then activate the fire method for the first n weapons.  </p>
  
  <pre><code>    public class Spaceship implements Drawable
   {
      private Weapon [] mountedWeapons = new weapon[4];
      private int curWeapon = 0;
     public void draw()
     {
         System.out.print("Ship will be drawn here");
      }
     public void addWeapon(Weapon w)
     {
         if (curWeapon&lt;mountedWeapons.length)
         {
             mountedWeapons [curWeapon] = w;
             curWeapon++;
          }
          else System.out.print("The weapons bay is full Commander");
      }
     public void fireFastestWeapon(int n)
     {
         int count=mountedWeapons.length;
         int k;
          for (int m = count; m&gt;=0;m--)
          {
              for(int i = 0; i&lt;count-1;i++)
              {
                  k=i+1;
                  if (mountedWeapons[i].compareTo(mountedWeapons[k]) == 1){
                      Weapon temp;
                      temp = mountedWeapons[i];
                      mountedWeapons[i] = mountedWeapons[k];
                      mountedWeapons[k] = temp;
                  }
              }
         }
  
         if(n&gt;mountedWeapons.length)
         {
             n=mountedWeapons.length;
          }
         for (f=0;f&lt;n-1;n++)
         {
             mountedWeapon[f].fire;
         }
     }
  }
  </code></pre>
  
  <p>Thank you for looking!</p>