title: How to access a method from another if it has arguments
body: <p>I want to know how I can access a call a method when it has an arraylist as an argument from an another class.</p>
  <pre><code>import java.util.*;
  class Business
  {
  public static void main()
  {
      Scanner si = new Scanner(System.in);
      int t = 0;
      System.out.println(&quot;Enter--&quot;);
      System.out.println(&quot;1 to add a account&quot;);
      System.out.println(&quot;2 to check the balance&quot;);
      int d = si.nextInt();
      if(d==1)
      {
          add_account();
      }
      if(d == 2)
      {
          check();
      }
      
  }
  public static void add_account()
  {
      Scanner si = new Scanner(System.in);
      int min = 1000;
      int max = 9999;
      int acn;
      List&lt;Double&gt; ac = new ArrayList&lt;&gt;();
      List&lt;Integer&gt; cl = new ArrayList&lt;&gt;(); 
      List&lt;String&gt; al = new ArrayList&lt;&gt;(); 
      System.out.println(&quot;Enter the name of the account user&quot;);
      al.add(si.next());
      System.out.println(&quot;Enter the amount user has deposited&quot;);
      cl.add(si.nextInt());
      ac.add(Math.floor(Math.random() * (max - min + 1) + min));
      System.out.println(&quot;Please re-enter your name&quot;);
      String name = si.next();
      acn = al.indexOf(name);
      System.out.println(&quot;Your account number is &quot;+acn);
      System.out.println(&quot;Your account password is &quot;+ac.get(acn));
      System.out.println(ac);
      main();
  }
  public static void check(List&lt;Double&gt; ac)
  {
      Scanner si = new Scanner(System.in);
      System.out.println(&quot;Enter the account number whoose you want to check the balance&quot;);
      int c = si.nextInt();
      System.out.println(ac);
  }
  }
  </code></pre>
  <p>Here, I want to know how to access the check method, I think I have to write in something in the brackets . If so, can you tell me what to write, if not please tell how can I access the check method from the main method.</p>