View Single Post
Old Oct 20th, 2004, 1:33 AM   #1
stegamann
Newbie
 
Join Date: Oct 2004
Posts: 2
Rep Power: 0 stegamann is on a distinguished road
hey,
im very new to programming, and though im not an idiot, feel free to treat me like one.
so i have an assignment in which i have to read a series of doubles, print them, sort them and print the sorted array, all in different methods.
so im pretty sure i could do it in the main, but when i try to return an array from the service method to the main. im getting an error that says .class expected. well i guess i should post the bit.
double[] series = new double[100];
int index=0;
System.out.println("Please input a series of numbers. "+"Input -888 when you are done.");
double y = SavitchIn.readDouble();
while (y != -888)
{
series[index]=y;
index++;
y=SavitchIn.readDouble();
}
return series[];
so if i try to compile that, i get...
Service.java:23: '.class' expected
        return series[];
                  ^
1 error
anyone have any clue what im doing wrong?
i know it seems like nothing but it would be a big help to me. thanks.

(EDITED (SykkN): fixed your [ CODE ] tags ...)
stegamann is offline   Reply With Quote