Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Re: iterating t...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 11 Topic 15994 of 16466
Post > Topic >>

Re: iterating through an array of String's

by thufir <hawat.thufir@[EMAIL PROTECTED] > Apr 23, 2008 at 04:06 AM

On Tue, 22 Apr 2008 06:44:11 -0700, Ian Kidder wrote:


> if only i knew a good mentat joke . . .

I should collect some!

> you are getting memory pointers from the run because you only have one
> for loop and you are walking through a 2-d array. the output is
> basically DATA[0], DATA[1]. to walk through a two dimensional array, you
> need nested for loops.

Right, thanks for explaining what the result was!  What I actually wanted 
to do was:


	public static String TWO_D_ARRAY = {
	{ "00", "01", "02" },
	{ "10", "11", "12" },
	{ "20", "21", "22" }},

	public static String[] data;

	data = TWO_D_ARRAY(0);  //grabs 00, 01, 02

to just grab a single row.  seems silly to me, but this was, essentially, 
a requirement of the lab (to grab a row without explicitly iterating).

I think it's rather arcane, but it makes me wonder if there's some 
similar "magical" technique for grabbing column.


-Thufir
 




 11 Posts in Topic:
iterating through an array of String's
thufir <hawat.thufir@[  2008-04-20 08:50:00 
Re: iterating through an array of String's
Roedy Green <see_websi  2008-04-20 10:04:03 
Re: iterating through an array of String's
Thufir <hawat.thufir@[  2008-04-30 03:43:18 
Re: iterating through an array of String's
Roedy Green <see_websi  2008-04-20 10:05:35 
Re: iterating through an array of String's
voorth <voorth@[EMAIL   2008-04-21 03:51:03 
Re: iterating through an array of String's
Lew <lew@[EMAIL PROTEC  2008-04-21 07:12:00 
Re: iterating through an array of String's
thufir <hawat.thufir@[  2008-04-21 07:58:23 
Re: iterating through an array of String's
thufir <hawat.thufir@[  2008-04-21 10:34:52 
Re: iterating through an array of String's
Ian Kidder <ikidder@[E  2008-04-22 06:44:11 
Re: iterating through an array of String's
thufir <hawat.thufir@[  2008-04-23 04:06:25 
Re: iterating through an array of String's
Lew <lew@[EMAIL PROTEC  2008-04-23 00:19:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 10:50:00 CDT 2008.