1. //类型后面加?表示可为空
    2. var age: String? = "23"
    3. //抛出空指针异常
    4. val ages = age!!.toInt()
    5. //不做处理返回 null
    6. val ages1 = age?.toInt()
    7. //age为空返回-1
    8. val ages2 = age?.toInt() ?: -1