Răspuns:
public class Adunator{
private int a,b;
public void setA(int a)
{
this.a=a;
}
public void setB(int b)
{
this.b=b;
}
public int suma(){
return a+b;
}
public static void main(String []args){
Adunator a1 = new Adunator();
a1.setA(5);
a1.setB(7);
System.out.println(a1.suma());
}
}