ola amigos, nao estou conseguindo compilar este programa, afimam que o object1 ,que eu criei para usar o metodo que soma dois numeros, nao pode ser resolvido… poderiam me ajudar por favor
import javax.swing.*;
public class SumCours{
private int valuex;
private int valeuy;
public SumCours(int x, int y){
this.valuex = x;
this.valeuy = y;
}
public int sum(){
int valuer;
valuer = valuex + valuey;
return valuer;
}
public static void main(String[] args){
int x = 0;
int y = 0;
int result = 0;
x = Integer.parseInt(JOptionPane.showInputDialog("enter the first value"));
y = Integer.parseInt(JOptionPane.showInputDialog("enter the second value"));
SumCours object1 = new SumCours(x , y);
result = Object1.sum( );
JOptionPane.showMessageDialog(null, result,"the sum between the two values, is:", 0);
System.exit(0);
}
}
muito obrigado!