Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

missing return statement



Warning! I'm a noob!!! :)

The bold area in my coding below keeps telling me that it's "missing a return statement" when I compile. Please let me know what other information might be needed!

public class TryArray
{

public static void aveArr(String[] args)

{
int[] aveArr = {1,2,3,4,5,16};
double ave = 0.0;
int i = 0;
while(i public static double getSum(double[] doubleArr)
{
int[] sumArr = {1,2,3,4,5,16};
double sum = 0.0;
int i = 0;
while(i

public static void maxArr(String[] args)

{
int[] intArr = {-1,-2,-3,-4,-5,-6};
int max = intArr[0];
int i = 1;
while(i max)
{
max = intArr[i];
}
i++;
}

System.out.println("Max is " + max);

}

}