title: method sum in classs sample cannot be applied to given typpe
body: <p>hello guys below is my java code and iam getting an error please help to slove this, and can i get a brief explaination why this error is occuring. thanks in advance.</p>
  <pre><code>  the below is my code:
  </code></pre>
  <p>public class sample {</p>
  <pre><code>            static double sum( double x ,double y) {
  
               return x + y;
  
  
  
       }
  
      static double avg( double x , double y) {
  
       double sum = sum(x + y);
  
       return sum/2;
  
  
  
     }
  
     public static void main(String[] args) {
  
     double d = sum(3.0, 2.0);
  
     System.out.println(d);
  
     double d2=avg(1.0 , 2,0);
  
     System.out.println(d2);
  
  
  
    }
  </code></pre>
  <p>}</p>
  <p><em><strong><strong><strong><strong><strong><strong><strong>and am getting the following error for this code</strong></strong></strong></strong></strong></strong></strong></em>*******</p>
  <pre><code>    sample.java:7: error: method sum in class sample cannot be applied to given types;
  
              double sum = sum(x + y);
  
              required: double,double
  
               found:    double
  
              reason: actual and formal argument lists differ in length
  </code></pre>