Hi,
I'm giving a go at Java and found a problem I'm unable to solve here..
I want to display all the elements in an array. So, I did this:
|
Code:
|
public class Goober {
public static void main(String[] args) {
double[] classArray = {23.44, 33.23, 88.66, 34.34, 55.55, 33.44};
classArray = new double[5];
for (int i = 0; i < classArray.length; i++) {
System.out.println(classArray[i]);
}
}
} |
The output is this:
0.0
0.0
0.0
0.0
0.0
What is it that I've done wrong?
I'm using OpenJDK 6 on Arch Linux.