No, you cannot have const float []
Most often some var is processed
public static readonly float[] TEST = new float[] {1,2};
But this array itself is not immutable, so you often go around the lines
public static readonly IList<float> TEST = new ReadOnlyCollectioN(new float[] {1,2});
Finally, the final option is to create your own immutable representation of float [], which can be created and provide the same actions as float [], without modification.
source
share