I have to randomize an queue without using constraints

I just tried this code


class con;
  rand int a [$:4];
  int da [];
  
  function void post_randomize();
    foreach(a[i])
      a[i] = $urandom_range(20,30)
  endfunction
  
endclass

module tb;
  con c;
  initial
    begin
      c = new();
      assert(c.randomize);
      $display("size of ele is %d", c.a.size);
      $display("Queue = %p", c.a);
    end
endmodule