Java: how do I point at an array item through a variable? -


how point @ array item through variable? example:

string[] names;  int test = 10;  string myname = names[test]; 

the purpose same number item 2 different arrays, username/password program.

in example:

string[] names; int test = 10; string myname = names[test]; 

the variable myname reference string in array, giving new value:

myname = "fred"; 

will nothing array - you'd doing assigning new reference variable.

to give array element bew value, this:

names[test] = "fred"; 

Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

R - Plot: How to format in 10-base scientific notation and put it text, mtex, title etc functions? -

validation - How to pass paramaters like unix into windows batch file -