This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes vector object to array conversion..urgent.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "vector object to array conversion..urgent.." Watch "vector object to array conversion..urgent.." New topic
Author

vector object to array conversion..urgent..

karan, chopra
Ranch Hand

Joined: Jun 05, 2001
Posts: 115
hi all,
i have a vector containing some arrays,now when i want to extract these arrays from the vector then how should i do it.because if i just write the following:
arrayname = vector.firstElement();
then i get the following error:
testframenew.java:409: incompatible types
found : java.sql.Array
required: int[]
arr1 = (Array)stringreceive.firstElement();
please suggest some solution,i would appreciate it..
regards
karan
PS- arrayname is an array of type int..
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Karan,
When you retrieve vector elements you must cast them back into the correct objects. In your case:
arrayname = (int[])vector.firstElement();
should work.
Manfred.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: vector object to array conversion..urgent..