I am confused as to why this array (cumulativeWeights) is said to be null. Here is my (simplified) code:

```
public class WeightedDieTester
{
    public static void main(String[] args)
    {
        WeightedDie d = new WeightedDie();
    }
}

```

---

```
public class Die
{
    public Die()
    {
        this.roll();
    }
}

```

---

```
public class WeightedDie extends Die {
    double[] cumulativeWeights = {.1, .2, .3, .4, .5, 1};

    public WeightedDie() {
    }
    public int roll() {

        for (int i = 0; i < cumulativeWeights.length; i++) { //this is where the nullpointerException is occuring
            if (randNum < cumulativeWeights[i]) {
                return i + 1;
            }
        }
        return 6;
    }
}

```

So yeah, cumulativeWeights has been initialized and should not be null. Does anyone know why it I am getting that nullpointerexception?