Wednesday, 15 May 2013

merging two objects of strings. java -



merging two objects of strings. java -

i have assignment requires me create ordered string list objects. have 2 ordered string lists, each 7 string values in them. im trying create method merges list mylist , yourlist combined list combinedlist.

here have far.

public boolean merge(orderedstringlist mylist, orderedstringlist yourlist){ int index; string value; (index = 0;index < numused; index++){ value = mylist.storage[index]; combinedlist.insert(value); } (index = 0;index < numused; index++){ value = yourlist.storage[index]; combinedlist.insert(value); } }

i declare object combinedlist in main, , doesnt recognize in orderedstringlist.class

the insert function insert strings alphabetical order.

if declared combinedlist within main function, accessible within main function.

what should create combinedlist within above function , homecoming result calling function i.e. main function.

java string list

No comments:

Post a Comment