mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Added some pattern matching
This commit is contained in:
parent
3cc4c64fb7
commit
d346342ad6
@ -121,3 +121,25 @@ val text = if (x == 10) "yeah" else "nope"
|
||||
|
||||
// Object oriented features
|
||||
|
||||
class Person
|
||||
|
||||
|
||||
|
||||
// Case classes
|
||||
|
||||
case class Person(name:String, phoneNumber:String)
|
||||
|
||||
Person("George", "1234") == Person("Kate", "1236")
|
||||
|
||||
|
||||
|
||||
// Pattern matching
|
||||
|
||||
|
||||
// Regular expressions
|
||||
|
||||
|
||||
// Strings
|
||||
|
||||
|
||||
// Input and output
|
Loading…
Reference in New Issue
Block a user