Re: a problem in transfer a int to Object
- From: John Gordon <gordon@xxxxxxxxx>
- Date: Mon, 30 Oct 2006 22:09:20 +0000 (UTC)
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
.
- Follow-Ups:
- Re: a problem in transfer a int to Object
- From: jartur
- Re: a problem in transfer a int to Object
- References:
- a problem in transfer a int to Object
- From: fAnSKyer
- a problem in transfer a int to Object
- Prev by Date: How to make display sleep (aka go off) in Java cell phone program
- Next by Date: Re: Commercial Java program bundled with 'free' database?
- Previous by thread: a problem in transfer a int to Object
- Next by thread: Re: a problem in transfer a int to Object
- Index(es):