class BankAccount {
private String firstname;
private String lastname;
private int ssn;
private int accountnumber = 0;
private double accountbala
A void
method cannot return
someting. And a method which have a return type must return
the type specified in method signature.
Error 1
For example look this method
public void setAccountNumber(int accountnumber) {
return accountnumber;
}
Yo cannot return from a void
method.
That should be
public void setAccountNumber(int accountnumber) {
this.accountnumber =accountnumber;
}
Same goes for remaining methods too.
Error 2
public void deposit(double amount) {
return this.accountbalance = this.accountbalance + amount;
}
that return statement is syntactically wrong. You cannot return as it is void. That should be
public void deposit(double amount) {
this.accountbalance = this.accountbalance + amount;
}