/*
Il metodo somma contiene un errore. Quale?
*/
public class ErroreReturn {
int x,y,z;
public ErroreReturn (int x,int y,int z) {
this.x = x;
this.y = y;
this.z = z;
}
public int somma (int n) {
if (n==1) return x;
else if (n==2) return x+y;
else if (n==3) return x+y+z;
}
}
|