Hello, I'm trying to learn arrays.
This is a simple java class that
1. defines an array private static to be accesible from within the whole class
2. fills array of int
3. prints content of array of int
I do not understand why, but it never gets into the foor loop to fill in the array... it should show me
4 (vector.lenght)
0 (vector[0])
1 (vector[1])
2 (vector[2])
3 (vector[3])
But I only get
4 (vector.lenght)
public class Vector {
private static int[] vector = new int[4];
public static void main (String[] args) {
System.out.println(vector.length);
//fill
for (int i = 0; i > vector.length; i++) {
System.out.println(i);
vector=i;
}
//print
for (int i = 0; i > vector.length; i++) {
System.out.println("Vector position " + i + " = " +vector[i]);
}
}
}