Contenido del Curso
Java JUnit Library. Types of Testing
Java JUnit Library. Types of Testing
Handling Exceptions Practice
Task
Write code to handle exceptions in Java using the try-catch
structure. You will work with methods that throw various exceptions. Your task is to correctly handle these exceptions in the main
method.
Expected output result:
Note
In this task, there won't be any unit tests because, later, you'll have to write them for this task yourself. The successful completion of this task will result in the expected output being displayed on the screen.
main
method to handle exceptions thrown by
checkAge
and printLength
.
catch
block, print an error message that should include
the type of exception and its description.
¿Todo estuvo claro?
Contenido del Curso
Java JUnit Library. Types of Testing
Java JUnit Library. Types of Testing
Handling Exceptions Practice
Task
Write code to handle exceptions in Java using the try-catch
structure. You will work with methods that throw various exceptions. Your task is to correctly handle these exceptions in the main
method.
Expected output result:
Note
In this task, there won't be any unit tests because, later, you'll have to write them for this task yourself. The successful completion of this task will result in the expected output being displayed on the screen.
main
method to handle exceptions thrown by
checkAge
and printLength
.
catch
block, print an error message that should include
the type of exception and its description.
¿Todo estuvo claro?