That would be technically impossible. If you create an array as int, the ints are stored directly in the array. If you create it as Object or Integer, the references are stored in the array and the object elsewhere (on the heap). So suppose you had:
Now, the compiler, when it compiles class B does not know that the objects array is full of ints and threats it as if it was full of references. So when you try to access objects, it generates instructions to access an object via a reference. Auto(un)boxing happens at compile time, so there is no possibility to make an object from that int during runtime.