Quick actions

cmd+k|ctrl+k

Navigation

Languages

Exception Handling

Snippet info

Language

Kotlin

Visibility

public

Author

habib17

Created

2019-11-03T11:20:38Z

Updated

2019-11-03T11:20:38Z

fun main(args : Array<String>){
   val someNullValue: String? = null
   lateinit var someMustNotNullValue: String
   try{
       someMustNotNullValue = someNullValue!!
       println(someMustNotNullValue)
   }
  /* catch(e: Exception){
       someMustNotNullValue = "Nilai String Null"
       println(someMustNotNullValue)
   }*/
   catch (e: Exception) {
        someMustNotNullValue = "Nilai String Null"
    } finally {
        println(someMustNotNullValue)
    }
   
}
INFO