Skip to content

Commit 294315e

Browse files
committed
Atm task: add YT link, adjust javadoc, make fields final
1 parent f1dab6b commit 294315e

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

  • src/main/java/by/andd3dfx/common/atm

src/main/java/by/andd3dfx/common/atm/Atm.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@
88
/**
99
* <pre>
1010
* Есть банкомат (ATM), который заряжают купюрами.
11-
* Надо реализовать метод withdraw() для выдачи заданной суммы amount имеющимися в банкомате купюрами.
12-
* Метод withdraw() - мутирующий, т.е. меняет состояние банкомата после вызова (кол-во купюр может уменьшиться):
13-
* Map<Integer, Integer> withdraw(int amount)
11+
*
12+
* Надо реализовать метод <code>Map&lt;Integer, Integer&gt; withdraw(int amount)</code> для выдачи заданной суммы
13+
* <code>amount</code> имеющимися в банкомате купюрами.
14+
* Метод <code>withdraw</code> - мутирующий, т.е. меняет состояние банкомата после вызова (кол-во купюр может уменьшиться).
1415
* </pre>
1516
*
16-
* @see <a href="https://youtu.be/LDKZtDevRRI">Video solution 1</a> and <a href="https://youtu.be/0-BL-NO9-B8">Video solution 2</a>
17+
* @see <a href="https://youtu.be/LDKZtDevRRI">Video solution 1</a>
18+
* and <a href="https://youtu.be/0-BL-NO9-B8">Video solution 2</a>
19+
* and <a href="https://youtu.be/1JrcFU_Wig8">Video solution 3</a>
1720
*/
1821
public class Atm {
1922

20-
private Map<Integer, Integer> state;
21-
private List<Integer> nominals;
23+
private final Map<Integer, Integer> state;
24+
private final List<Integer> nominals;
2225

2326
public Atm(Map<Integer, Integer> state) {
2427
this.state = new HashMap<>(state);

0 commit comments

Comments
 (0)