Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
2
Task/Null-object/Swift/null-object-1.swift
Normal file
2
Task/Null-object/Swift/null-object-1.swift
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
var opt : Int? = nil // use "nil" to represent no value
|
||||
opt = 5 // or simply assign a value to the optional type
|
||||
5
Task/Null-object/Swift/null-object-2.swift
Normal file
5
Task/Null-object/Swift/null-object-2.swift
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
if let v = opt {
|
||||
println("There is some value: \(v)")
|
||||
} else {
|
||||
println("There is no value")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue