title: How do I store positive and negative value (may be separately?) into an array, and print them out?
body: <p>My program will ask user to enter 10 numbers. The positive numbers are considered as Deposit and negatives numbers are considered as withdraw. After finish, the program should print out the amounts the user has entered.</p>
  
  <p><strong><em>My problem is I can't set the logic for storing them into array. I can't figure out how do I separate the positive and negative values into an array.</em></strong></p>
  
  <p>This is what I have done so far:</p>
  
  <pre><code>package depandwith;
  
  import java.util.*;
  public class DepAndWith {
  
          public static void main(String[] args) {
              Scanner input = new Scanner(System.in);
  
              System.out.println("TO DEPOSIT USE POSITIVE AND, TO WITHDRAW USE NEGATIVE VALUE.\n\n");
              for (int i = 0; i &lt; 10; i++) {
                  System.out.println("Enter amount: ");
                  int amount[] = new int[10];
                  amount[i] = input.nextInt();
  
                  if (amount[i] &gt;= 0) {
                      //store it as deposited
                  } else {//if the amount is negative
                      //store it as withdrawn
  
                  }
  
              }
  
              //Printing the amounts:
              for (int i = 0; i &lt; 10; i++) {
                  System.out.println("Print out Deposited amount");
                  System.out.println("Print out Withdrawn amount");
  
              }
  
          }
  }
  </code></pre>