Trying to invoke a method called addAccount for a bank application but it keeps giving me .class is expected error

后端 未结 3 1978
北海茫月
北海茫月 2021-01-26 11:25

This has been giving me error when I try to invoke the addAccount method saying .class is expected on the line where I try to invoke it.
I am trying to do an as

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-26 11:41

    you have declared it static so you need to add the class name before the call

    bank.addAccount(int accountNo,double accountBal);
    

    and instead of the types decleration you have to call it with parameters.

    bank.addAccount(accountNo,accountBal);
    

提交回复
热议问题