java - How can I specify an array as a parameter -


i have following method:

public void testmethod() {     string id = card.people[4];     id = card.rooms[4];              } 

string id should either equal card.people[4] or card.rooms[4]. how can specify in parameter id should equal?

this general format use:

public void testmethod(mytype[] array) {     mytype fourthelement = array[4]; } 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -