Skip to content

JavierDolo/S1.02.ExceptionsLevel2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Exercise 1 - Handling Input Exceptions in Java

πŸ“„ Description

This exercise involves creating a class called Entrada designed to handle various exceptions that may arise when entering data via the keyboard using the Scanner class in Java.

The class should instantiate a Scanner object and provide static methods to read different types of data from the keyboard. If an exception occurs while reading the input, the program should handle it and prompt the user again until the correct data is entered.

For example, if a user enters a float with a dot instead of a comma, the program should display "Format error", and keep asking for input until the user enters a correctly formatted float.

Each method receives a string containing a message to display to the user (e.g., "Enter your age") and returns the correctly entered data.

πŸ’» Technologies Used

  • Java
  • Scanner class
  • Exception handling (InputMismatchException and custom Exception)
  • Object-oriented programming principles

πŸ“‹ Requirements

  • Java Development Kit (JDK) installed.
  • A Java-compatible IDE or text editor.
  • Basic knowledge of exception handling in Java.

πŸ› οΈ Installation

  1. Clone the repository:
    git clone <repository_url>
  2. Navigate to the project directory: cd project_directory
  3. Open the project in your preferred IDE.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages