Alright, so I'm pretty new here and new to Java, and I'm sitting here working on my homework and I think that I've got the code correct, but I keep getting this error on my program:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The Program itself looks like this:
import javax.swing.JOptionPane;
public class study2 {
public static void main(String[] args) {
String temp1 , temp2;
int num1 , num2, max = 0;
String choice="";
do{
JOptionPane.showInputDialog("The First Number is:");
num1 = Integer.parseInt(temp1);
JOptionPane.showInputDialog("The Second Number is:");
num2 = Integer.parseInt(temp2);
if (num1 > num2)
max = num1;
else max = num2;
JOptionPane.showMessageDialog(null,"The Maximum is" +max);
JOptionPane.showInputDialog(null, "Would you like to continue?: ");
} while (choice.equals("yes")||choice.equals("Yes"));
}
}
I would immensely appreciate any help on this error, or how to fix whatever I did wrong.