Wednesday, 2 October 2013

Collection and toArray in Scala

Collection and toArray in Scala

Java code:
Collection<MethodInfo> items = getItems();
MethodInfo[] itemsArray = methods.toArray(new MethodInfo[methods.size()]);
I wonder, what would be the equivalent code in Scala?
val items: Seq[MethodInfo] = getItems
val itemsArray: Array[MethodInfo] = ???

No comments:

Post a Comment