I am pretty new to Java and I have three text fields which are all integers in my Java project. I want to create an if statement that throws an error if the sum of values in text field 1 and 2 are greater than textfield 3. This is what I was able to come up with
if (text3.getText() > (text1.getText()+text2.getText())){
System.out.println(“Error”)
}
Do I need to put it in a try and catch statement?