Manejo de excepciones kotlin

Ejemplos de código

3
0

try catch kotlin

try{
  // wirte here somethin that you thought it would throw expection
}
catch(e:Expection){ 
  e.printstacktrace() 
  // handle expection or write upper line of code
}
finally{
	// this block is optional 
  	// this will always run if expection come or not
}
1
0

kotlin lanzar la excepción

throw Exception("Exception message")

En otros idiomas

Esta página está en otros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................