Difference b/w program and module in the code and the reason for difference in o/p

I want to know the error in this code:

class a1;
  int q;
  task set(int i);
    q = i;
  endtask
  function int get();
    return q;
  endfunction
endclass

 `include "a1.sv"
module top;
  a1 class_1;
  a1 class_2;
  int a,b;
  initial
  begin
  class_1 = new();
  a1 class_2 = new();
  class_1.set(10);
  class_2.set(20);
  a = class_1.get();
  b = class_2.get();
  $display("The first value is %0d",a);
  $display("The second value is %0d",b);
  end
endmodule

I see that if I use program in stead of module the file top.sv executes properly
Can anyone look into this and tell me the reason

In reply to Ravi007:
I see no difference between module and program once I remove your typo "a1 class_2 = " should be just “class_2 =”

What error or differences do you see?

BTW, I recommend that you do not use program blocks.