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

javascript - CasperJS/PhantomJS failing SSL handshakes on some sites even with --ssl-protocol=any -

codeigniter - Fatal error: Call to undefined function lang() in CI Merchant using CardSave -

python - Received unregistered task using Celery with Django -