This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
HI, i have a list of strings in file. eg: values of Pid(is unique) and PC(can be more than 1) ABC1234<space>ABCDEFGF\n CDE2345<space>DEFGHEYT\n --- --- 10 items i opened the file. read each line to get string in. using subsrtring i store value in string1 and string2 till end of line. i loop it till end of file. Question is how to copy this string1 to a new string array- arr1Pid? same with string2- array arrayPc. I want to sort array_Pc. Please let me know how to do this one! thanks
It is probably easier to use Collections such as List or Set, depend on your need. If you want to keep the relationship between the PID and the PC, you might want to use Map. Those interfaces has the sorted implementation. and you can do toArray() when you are done processing if you really need them in array format. Check out javadoc on Collections and Map.