hi :)
I'm wondering >>what is the use of (static) word in func.'s ?
in this code what does it mean ??and if I didn't put it what would happen then ??
thanks :)
import java.util.Scanner;
class Average {
public static double compute(int...x)
{
double sum=0;
for(int item:x)
sum+=item;
return sum/x.length;
}
public static void main(String[] args) {
System.out.println("enter 3 no.'s");
Scanner obj=new Scanner (System.in);
int no1=obj.nextInt();
int no2=obj.nextInt();
int no3=obj.nextInt();
System.out.println("Average is =>"+ compute(no1,no2,no3));
}
}