Program to convert Java list of character to Traversable in Scala
A java list of characters can be converted to a Traversable collection in Scala by utilizing toTraversable method of Java in Scala. Here, you need to import Scala’s JavaConversions object in order to make this conversions work.
Now, lets see some examples and then discuss how it works in details.
Buffer(l, m, n)
Here, the stated output is in same order as stated in the given list.
Buffer(b, c, a)
Here, all the stated characters are not stated in proper order so, the resultant output is also not in correct order.
My Personal Notes arrow_drop_up
Please Login to comment...