Associative array of class based data type

class basic_env;
  int a;
endclass

module tb;
  basic_env m_env[unsigned int];

  initial begin 
     m_env = new():
  end

I am getting error saying new cannot be used on static arrays

How do we use associative array of class data type

With an associative array of a class based data type, you need to construct elements individually (or assign to an already constructed class instance)

initial begin 
     for (int i=1;i<11;i++) m_env[i] = new();
end