VOOZH about

URL: https://www.geeksforgeeks.org/scala/program-to-convert-java-set-of-shorts-to-stream-in-scala/

⇱ Program to convert Java Set of Shorts to Stream in Scala - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Program to convert Java Set of Shorts to Stream in Scala

Last Updated : 3 Jan, 2020
A java Set of Shorts can be converted to a Stream in Scala by utilizing toStream 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. Example:1#
Output:
Stream(100, ?)
Example:2#
Output:
Stream(-100, ?)
Comment
Article Tags:

Explore