title: How to call java method on main class
body: <p>I'm a beginner in Java and I have a very simple problem. I'm trying to finish an activity and I forgot how to call a method on the main class. </p>
  
  <p>I keep getting an error whenever I try ways to call the <code>computeSum</code> method on the main class.</p>
  
  <pre><code>Error: Error: Main method not found in class array.Array, please define the main method as: public static void main(String[] args)
  
  
  public class Array{
      public static void main(String[] args ){
          //Dont know what to put here to call computeSum
      }
  
      public int computeSum(int[] nums){
          int sum = 0;
          for (int i=0; i&lt;nums.length; i++){
              sum= sum+nums[i];
          }  
          return sum;    
      }
  }
  </code></pre>