Jump to content

can one constructor has two methods??

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
farhanyun91

farhanyun91

    Learning Programmer

  • Members
  • PipPipPip
  • 53 posts
can one constructor has two methods or we have to use inheritance ??

The account class was defined to model a bank account. An account has the properties account number, balance, annual interest rate, and date created, and methods to deposit and withdraw funds. Create two subclasses for checking and saving accounts. A checking account has an overdraft limit, but a saving account cannot be overdrawn. Write a test program that create objects Account, SavingAccount and CheckingAccount.

base on this question,is it asking me to inherit savingAccount to Account and CheckingAccount to SavingAccount??in the other word,is this has to do with abstraction??

#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
The assignment says that you create checkingAccount and savingAccount who both "extends Account", use inheritance.

I'm not sure why in the title you say "can one constructor has two methods??"