java2k
Controlling complexity is the essence of computer programming
Pages
Home
What is Java2k
Java examples
C++ Examples
Test your Java language skills
Showing posts with label
free java;java online learning;java tutorials;java programming;in java;variable length array; free java;java online learning
.
Show all posts
Showing posts with label
free java;java online learning;java tutorials;java programming;in java;variable length array; free java;java online learning
.
Show all posts
Saturday, 3 September 2011
Variable Length array in java
class abc
{
public static void main(String args[])
{
System.out.print(average(45,46.9,12,44,5,7,3,8));
}
public static double average(double...num)
{
double total=0,avg;
for(double x:num)
total+=x;
avg=total/num.length;
return avg;
}
}
Older Posts
Home
Subscribe to:
Posts (Atom)