Hey guys, I recently had an assignment to write a sort algorithm we have not yet gone over in class.
I had no problem getting my code written and to compile, but now that it compiles I keep getting an error that says

"Exception in thread "main" java.lang.NoSuchMethodError: main"

I figured their is an issue with my main section of code but I cannot figure it out, if anyone could help, thanks in advance.

public class shell
{
public shell(int[] anArray)
{
   a = anArray;
}

public void sort()
{
   int increment = a.length / 3 + 1;

   while ( increment > 1 )
   {
      for ( int start = 0; start < increment; start++ )
         insertSort( start, increment );

      increment = increment / 3 + 1;
   } 


   insertSort( 0, 1 );
}

public void insertSort( int start, int increment )
{
   int j, k, temp;

   for ( int i = start + increment; i < a.length; i += increment )
   {
      j = i;
      k = j - increment;
      if ( a[j] < a[k] )
      {

         temp = a[j];
         do
         {
            a[j] = a[k];
            j = k;
            k = j - increment;
         } while ( j != start && a[k] > temp );
         a[j] = temp;
      }
   }
}

private int[] a;
}

Sorry I messed up the code

Your class needs a main() method defined if you are going to run it directly.

public static void main(String[] args){
    ...
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.