il fatto è che io ho questo:
public Metodo get(String nomeCosa) throws MyException{
try{
int j = 0;
while ((((Cosa)(elencoCose.get(j))).getNome()) != nomeCosa){
j++;
}
return (Cosa)(elencoCosa.get(j));
} catch (MyException e) { e.cosaFantasma(); }
}
gli metto quel try catch per sollevare l'eccezione nel caso la Cosa non esista...
ma in compilazione mi dice:
The method cosaFantasma() is undefined for the type MyException
..
in MyException come lo devo implementare?
class cosaFantasma extends MyException {
...
}

Rispondi quotando