- 1
Can somebody help me with this error in Java?
I am new to Java Now learning inheritance but got a error. Below is a Code in Online Java IDE: https://www.jdoodle.com/a/3Q9f
3 Réponses
+ 2
Code doesn't show up in the link.
Better to post it in code playground and share it via that.
+ 2
SavingAccount requires constructor
because Account has one with parameters
class SavingAccount extends Account {
public SavingAccount(
String acc, String n, String add, String p ) {
super(acc, n, add, p);
}
-
there are 2x typos
balence instead
balance
-
deposit() can't see balance because is private,
but you can change declaration to
protected long balance;
-
rename
getname() to expected
getName()