Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  Calculator.java
Language: JAVA
Code:
public class Calculator {

     static{
          double a[]={1,6,3,9,5};
          double sum=getSum(a);
         System.out.println("sum is"+sum);
     }
     public static double getSum(double[] a){
          double sum=0;
          for(int i=1;i<=a.length;i++)
          {
               sum=sum+a[i];
          }
          return 0.0;
     }
}
          
Comments: