|
question about arrays
I am doing a bank project where we record deposits and withdrawals using positive and negative numbers. Using arrays we store the numbers, positive numbers being deposits and negative numbers being withdrawals. I have a method where all deposits and withdrawals are printed:
public void showAll() {
int index=0;
while (index < auditTrail.size())
{
System.out.println(auditTrail.get(index));
index++;
}
}
However I need a method where only deposits are printed and one where only withdrawals are printed. any advice would be much appreciated.
|