Hallo!
Die Frage ist wie folgt.Ich habe diese Abstrakte Klasse
Und jetzt soll ich von dieser Abstrakte Klasse zwei Konkrete Klasse erstellen.
Diese Klasse soll von AccountException erben,nun jetzt ist die frage mache ich dass hier richtig? Nämlich woll ich dass mir beim ausführen,wenn ich diese exception fange so etwas auf der Konsole vorkommt (That account doesnt exist account number 3). Will so etwas passieren oder nicht?
Die Frage ist wie folgt.Ich habe diese Abstrakte Klasse
Java:
public abstract class AccountException extends BankServiceException {
private int accountNo;
public AccountException(String message, int accountNo) {
super(message);
this.accountNo = accountNo;
}
public int getAccountNo() {
return accountNo;
}
}
Und jetzt soll ich von dieser Abstrakte Klasse zwei Konkrete Klasse erstellen.
Java:
public class NoSuchAccountException extends AccountException {
public NoSuchAccountException(int accountNo) {
super("That account does not exist",accountNo);
}
}