add test files
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
fun main(args : Array<String>) {
|
||||
println(getStringLength("aaa"))
|
||||
println(getStringLength(1))
|
||||
}
|
||||
|
||||
fun getStringLength(obj : Any) : Int? {
|
||||
if (obj is String)
|
||||
return obj.length // no cast to String is needed
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user