Conversation
Task 1-Bank System/src/Account.java
Outdated
| @@ -0,0 +1,36 @@ | |||
| public class Account { | |||
| private long accountNumber; | |||
There was a problem hiding this comment.
what is the maximum range of Long ?
what if I have number of accounts greater than the max size of long ?
so , use String instead and search for the above questions :)
Task 1-Bank System/src/Bank.java
Outdated
| @@ -0,0 +1,30 @@ | |||
| import java.util.ArrayList; | |||
| public class Bank { | |||
| ArrayList<SavingsAccount>accounts = new ArrayList<>(); | |||
There was a problem hiding this comment.
the initialization of this array list should be inside the constructor
There was a problem hiding this comment.
I did but when I tried to add a new saving account as an employee and then tried login as a customer with this account number, it failed.
| @@ -0,0 +1,11 @@ | |||
| public class SavingsAccount extends Account { | |||
| private double interestRate = 0.05; // assume the interest rate = %5 | |||
There was a problem hiding this comment.
must be final as it's constant
Task 2-problem solving/Two Sum.java
Outdated
| @@ -0,0 +1,16 @@ | |||
| import java.util.Hashtable; | |||
There was a problem hiding this comment.
accepted solution. try to solve it using two pointers technique
| @@ -0,0 +1,15 @@ | |||
| import java.util.Hashtable; | |||
There was a problem hiding this comment.
the more memory optimized solution will be using frequency array so try to solve it using it
Before reviewing task 1, please check the README file first.