So I am trying to create an immutable array of size 10 within a mutable array in scala. In this immutable array I want to store key, value pairs. so far I have this mutable array:
val array1 = mutable.ArrayBuffer[Option[IndexedSeq[(A,B)]]]()
Now to create an immutable buffer in array1 would I just do:
array1(0) = immutable.ArrayBuffer[](10)
I am confused on what would go within the brackets of the immutable buffer for the type.
immutable.ArrayBufferto the first position ofarray1, is what what you want to do?array1is anmutable.ArrayBuffer[Option[IndexedSeq[(A,B)]]]thus the elements must beOption[IndexedSeq[(A,B)]]not animmutable.ArrayBufferso what you want to do doesn't make sense.