Have you compiled the code? That error usually relates to attempting to run a main method in a file that has not yet been compiled. If that was a compiler error, which line(s) give the error?
darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200
You should read a value, parse it put in your array and then start over. You cannot have parsedouble[] (actually the correct version is parseDouble(args)). When you read a value, you cannot convert it to an array. Just put it to the next location in your array.
Chaster
Junior Poster in Training
68 posts since Jun 2007
Reputation Points: 12
Solved Threads: 3
I mean:
double temp = Double.parseDouble(keyIn.readLine());
an then:
height[i] = temp;
Chaster
Junior Poster in Training
68 posts since Jun 2007
Reputation Points: 12
Solved Threads: 3
I changed the parse thing to
height = Double.parseDouble(KeyIn.readLine());
and now I get the error:
Incompatible types - found Double but expected Double[]
That's because height is an ARRAY but you here need a PRIMITIVE. You can use either a temp variable (as I described earlier), or try this: height[i] = Double.parseDouble(...);
Chaster
Junior Poster in Training
68 posts since Jun 2007
Reputation Points: 12
Solved Threads: 3