![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2004
Posts: 2
Rep Power: 0
![]() |
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[];Service.java:23: '.class' expected
return series[];
^
1 errori know it seems like nothing but it would be a big help to me. thanks. (EDITED (SykkN): fixed your [ CODE ] tags ...) |
|
|
|
|
|
#2 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Could you post the whole thing?
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Oct 2004
Posts: 2
Rep Power: 0
![]() |
Here is the whole service method.
this is what is giving me the error. public class Service
{
public static char convert(char letter)
{
int x;
x =(int)letter +32;
letter=(char)x;
return letter;
}
public double[] read()
{
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[];
}
}thanks (EDITED (SykkN): same thing here ...) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|