You aren't getting a compilation error, you're actually getting a runtime exception.
Looking up the
ArrayStoreException
in the
Java documentation[
^] you might find that you are trying to fill an array of doubles with integers (and you cannot do that).