Created
September 22, 2011 14:35
-
-
Save notyy/1234930 to your computer and use it in GitHub Desktop.
can match any parameter
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
def tryMatch: PartialFunction[Any, Unit] = { | |
case s:String => println("its a string:" + s) | |
case (s1:String,s2:String) => println("two strings:" + s1 + " and "+ s2) | |
case i:Int => println("its a int:" + i) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment