Hi all,
I am not new to java, but I'm quite confused by this problem I've been
given. I have to create a function of this type:
public boolean checkInfo(Array info);
However, I have never used type 'Array' before and haven't yet found
info to help create an object of that type (only the ability to use
java.lang.reflect.Array functions on array types). Array objects I've
come across before are things like int[], char[], float[] and so forth,
not actual 'Array' objects. How do I use this type?
Thanks for any help,
~ickz~
Stefan Schulz - 20 Feb 2005 12:52 GMT
> Hi all,
> I am not new to java, but I'm quite confused by this problem I've been
[quoted text clipped - 6 lines]
> come across before are things like int[], char[], float[] and so forth,
> not actual 'Array' objects. How do I use this type?
There is no "common ancestor" to all Arrays except Object. The best you
could do would be to overload the function to accept all primitive arrays
(int [], long[], short[], byte[], char[], float[], double[] and
Object[]), this way enabling all array types to be passed. However, are
you sure you understood your assignment correctly? It looks like an
ulikely job.

Signature
In pioneer days they used oxen for heavy pulling, and when one ox
couldn't budge a log, they didn't try to grow a larger ox. We shouldn't
be trying for bigger computers, but for more systems of computers.
--- Rear Admiral Grace Murray Hopper
Hal Rosser - 20 Feb 2005 21:15 GMT
> Hi all,
> I am not new to java, but I'm quite confused by this problem I've been
[quoted text clipped - 9 lines]
> Thanks for any help,
> ~ickz~
This could be interesting. The Array class is final.
I would clarify the assignment with the Instructor/ or boss.