Re: a problem in transfer a int to Object



In <1162244131.157015.178990@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> "fAnSKyer" <fanskyer@xxxxxxxxx> writes:

here is the problem
I have an Object[] args[];

I want use this array args to transfer the values.
For example args[0] is a int; args[1] is a string.

The problem is I can't change a int to string, I use this way

int refer=1
args[0]= (Object) refer;

You can't cast an int to an Object. Do this instead:

args[0] = new Integer(refer);

--
John Gordon "It's certainly uncontaminated by cheese."
gordon@xxxxxxxxx

.