Como son las excepciones en kotlin | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Como son las excepciones en kotlin

try catch

17th Oct 2021, 4:23 PM
Daniel 😊😎😉[JS Challenger]
Daniel 😊😎😉[JS Challenger] - avatar
3 Answers
+ 2
Daniel No sé en Kotlin, pero por el mensaje que ví de SAN es parecido al de las excepciones de JavaScript.
17th Oct 2021, 6:36 PM
CGO!
CGO! - avatar
+ 1
usamos el bloque try-catch para el manejo de excepciones en el programa. El bloque try encierra el código que es responsable de lanzar una excepción y el bloque catch se usa para manejar la excepción. Este bloque debe escribirse dentro de los métodos principal o de otro tipo. try { // code that can throw exception } catch(e: ExceptionName) { // catch the exception and handle it }
17th Oct 2021, 5:11 PM
SAN
SAN - avatar
+ 1
SAN Gracias
17th Oct 2021, 5:15 PM
Daniel 😊😎😉[JS Challenger]
Daniel 😊😎😉[JS Challenger] - avatar