Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can anyone tell me why this wont compile? Its just like an example that my instr

ID: 3663598 • Letter: C

Question

Can anyone tell me why this wont compile? Its just like an example that my instructor showed us

I need help debugging the rest of it

public class OrderedList
{
   private int[] a;
   private int b;
   OrderedList ()
   {
       a = new int[10];
   }
   public void insert (int var)
   {
       int j = 0;
       for (int i= 0; i < b; i++, j++)
       if(var < a[i]) break;
       for (int i = b - 1; i > j; ) a[i] = a[i--];
       a[j]= var;
   }
   public void print ()
   {
       for (int i = 1; i < b; i++)
       {
           if (i%5 ==0) System.out.println();
       System.out.print(a[i] + " ");  
       }
   }
}

Explanation / Answer

To debug it you should include the main method as following

public static void main(String[] args) {
     OrderList t=new OrderList();
     t.insert(11);
     t.print();
    
    }

if you dont get it post the question instead of the program