Exception handling for int variables

  • Thread starter Thread starter spaghetti3451
  • Start date Start date
  • Tags Tags
    Variables
AI Thread Summary
The discussion centers on creating a Java program that takes two integer inputs from the user and calculates their sum while handling all possible exceptions. Participants emphasize the importance of demonstrating effort in coding before seeking help. Suggestions for exception handling include checking for input validity and managing potential errors such as non-integer inputs. The conversation highlights the need for clear coding practices and robust error management. Overall, the focus is on developing a functional program with proper exception handling techniques.
spaghetti3451
Messages
1,311
Reaction score
31

Homework Statement



Handle all possible exceptions for a program that takes two int number from the user and print sum.

Homework Equations



The Attempt at a Solution



import java.util.Scanner;

public class Task1
{
}
 
Physics news on Phys.org
Surely you can write the program that reads two int without exceptions right? we can't help if you don't show some effort.
 

Similar threads

Back
Top