In Scala, a Array is just a JVM array, and the various Buffer are actual classes.
An Array[String] ist the same as String[] in Java. You can think of ArrayBuffer as ArrayList in Java (they are very similar, but not equivalent) and ListBuffer as Java LinkedList (again, it seems, but not the same).
It should be noted, however, that in your example eventbuffer not a Buffer , but an array of arrays. This is actually a fairly accurate copy of myMatrix , so calling the toArray method is actually superfluous.
source share