Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FlatAmountProvisionTransaction(long fromId, long toId,String amount, String flatProvision) кој го иницијализира полето за опис на "FlatAmount" и соодветен get метод
- sega treba da zemam obicen konstruktor t.e prvicen e
- public FlatAmountProvisionTransaction(long fromId, long toId, String description, String amount) {
- super(fromId, toId, description, amount);
- }
- i na mestoto na amount treba da stoi FlatAmount
- i da izgleda vaka
- AKO SAKAME ID DA SE ZGOLEMUVA SEKVENCIJALNO
- private String accountOwner;
- private int id; //se odnesuva na momentalna smetka //se cuva lokalno na nivo na account
- private static int idSeed=1; //se cuva na nivo na klasa //static oti e na nivo na klasa a i dr klasi ke nasleduvaat od account
- private double currentAmount;
- public Account(String accountOwner , double currentAmount)
- {
- this.accountOwner=accountOwner;
- this.currentAmount=currentAmount;
- this.id=idSeed++;
- }
- SITE METODI VO EDEN INTERFEJS SE UBLIC
- DODAVANJE NA NOV ACCOUNT VO NIZA SE PRAVI::::
- private Account[] accounts;
- private int totalAccounts;
- private int maxAccounts;
- public Bank(int maxAccounts) {
- this.maxAccounts = maxAccounts;
- this.accounts = new Account[maxAccounts];
- this.totalAccounts = 0;
- }
- public void addAccount(Account account)
- {
- accounts[totalAccounts++]=account;
- }
- STARIOT POKAZUVAC POMESTI GO NA NOVO MESTO DA POKAZUVA SO NOVA/DUPLA MMEMORIJA, NA LEVO E STARA GOLEMINA DESNO E NOVA GOLEMINA
- accounts=Arrays.copyOf(accounts,maxAccounts*2);
- maxAccounts*=2;
- STARIOT POKAZUVAC NA accounts ZAMENI GO SO NOV SO POGOLEMA MEMORIJA
- ZA DALI NESTO IMPLEMENTIRA INTERFEJS SE PROFESOVERUVA SO instanceof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement