Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

vector object to array conversion..urgent..

 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i have 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
 
Junaid Bhatra
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should work assuming you have a vector of int arrays:
int[] array = (int[])vector.firstElement();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic