Created
January 21, 2014 22:36
-
-
Save shaunoconnell/8549888 to your computer and use it in GitHub Desktop.
scala sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.collection.JavaConversions._ | |
object SampleSort { | |
def main(args:Array[String]) = { | |
val myHash = new java.util.concurrent.ConcurrentHashMap[String,String]() | |
myHash.put("foo", "last") | |
myHash.put("bar", "first") | |
myHash.keys().toList.sorted.foreach((key:String) => { | |
val v = myHash.get(key) | |
println(s"$key: $v") | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment