There's always a way, and the way won't always (usually isn't) the first one you think of.
If the machine you describe is mostly for show, then it could return a String representation of the desired int array: "{1,2,3,4,?}", "{1,2,3,?,?}", and "{1,2,?,?,?}". If there's some function required from those values, then you may have to parse the String representations into the necessary values. You could also use an Object[] array that could contain both Integer and String objects, but that could get messy, depending on what you do next with it.
How the data is stored in your program doesn't have to be what you show the user.