Skip to content

Conversation

@Soullloud
Copy link

Input Validation:
In the bookRoom method, you should validate user input for room numbers to ensure it's a valid integer.
Add input validation for other user inputs to prevent crashes due to invalid input.

Thread Safety:
When using multi-threading (e.g., writing data to the "backup" file), you should consider thread safety. Accessing shared data without proper synchronization can lead to data corruption. You might want to use synchronization mechanisms like synchronized blocks or methods to ensure thread safety.

Error Handling:
In your main method, when reading the "backup" file, you catch and print exceptions with a generic message ("Not a valid input"). It's essential to handle exceptions more gracefully. For example, you can print a specific error message or log exceptions for debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant