Appearance
Lesson 4 Practice — Bank Account Object
Create:
text
ZCL_BANK_ACCOUNT_###
ZCL_ABAP_L04_PRACTICE_###Bank Account state
Keep private:
text
account_id
owner_name
balancePublic API
Create:
text
constructor
deposit
withdraw
get_account_id
get_owner_name
get_balanceRules:
text
initial balance cannot be negative
deposit must be > 0
withdraw must be > 0
withdraw cannot exceed balancewithdraw should return abap_bool indicating success.
Runner
Create at least two accounts and prove their balances are independent.
Questions
- Why is
balanceprivate? - Why is
withdrawbetter than a genericset_balance? - What does
NEWreturn? - What does
->mean? - What is the difference between a class and an object?