What is the most efficient way to create empty ListBuffer ?
val l1 = new mutable.ListBuffer[String]
val l2 = mutable.ListBuffer[String] ()
val l3 = mutable.ListBuffer.empty[String]
There are any pros and cons in difference?
Order by efficient:
new mutable.ListBuffer[String]
mutable.ListBuffer.empty[String]
mutable.ListBuffer[String] ()
You can see the source code of ListBuffer
& GenericCompanion