Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun main(args: Array<String>) {
- val location: Any = "Code must compile!"
- val safeString: String? = location as? String
- val safeFloat: Float? = location as? Float
- println(safeString)
- println(safeFloat)
- }
- //Compiler returns this output:
- Code must compile!
- null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement