For example, for a single method that reads the elements of an array, how can the programmer allow either an array of objects or an array of primitives to be passed as the p
You can pass an array of either type as an Object.
From there, you have to use reflection. In particular isArray(), getComponentType(), and isPrimitive() will tell the method what it has been passed. It's some of the unfortunate untidiness introduced by primitive data types.