954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Java Array issue

I would like to know how you can input information from one array to another. For example
String A[]
A[0]= 2, 54, 6, 7
A[1]= 434, 32, 45
A[2]= 34, 45
A[3]= 20
Where all that are in "A" are actually seen as strings, and you want to input this into an int array called City "int City[]". I want to put all information from A into City, so that
City[0]= 2
City[1]= 54
City[2]= 6
City[3]= 7
City[4]= 434
City[5]= 32
and sooo on........ thing is I later on have to input city into a 2d array but I really don't know how to get on with the first bit. Please Help!!

yazz110
Newbie Poster
18 posts since Jul 2011
Reputation Points: 10
Solved Threads: 1
 

Please help :( :'(. I really need to understand this. I do know its a stupid question but I need help

yazz110
Newbie Poster
18 posts since Jul 2011
Reputation Points: 10
Solved Threads: 1
 
how you can input information from one array to another


You would use an assignment statement like with any other variables.
Left side of = receives the value
Right side of = is the source of the value
ar{i] = ad[j];

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: