How can I create a bank account id that will store name, account number, amount, phone and save them to an array list and approach will be the best so other classes can't access my inner workings of the class | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

How can I create a bank account id that will store name, account number, amount, phone and save them to an array list and approach will be the best so other classes can't access my inner workings of the class

advanced

27th Jul 2016, 8:44 PM
Paul Bereobong Clement
Paul Bereobong Clement - avatar
3 ответов
+ 1
class bankAccount{ private string name = ""; private string accountNum = ""; private float amount = 0; private string phoneNum = ""; public array data = arr(name, accountNum, amount, phoneNum); } I don't know much about Java, but this pseudocode should be of some use, I hope.
28th Jul 2016, 8:47 PM
Matt Ferrie
Matt Ferrie - avatar
0
you have tried your best I already know how to. code it for d amount is best to use double and for the array it's best to implement it on a new class to store the data from the calling class then set your rols on the deposit and withdrawal methods and then getters and setters to check or initialize customer details
5th Aug 2016, 3:03 PM
Paul Bereobong Clement
Paul Bereobong Clement - avatar
- 1
if you need the syntax let me know will write it
5th Aug 2016, 3:05 PM
Paul Bereobong Clement
Paul Bereobong Clement - avatar