Ask your own question, for FREE!
Computer Science 13 Online
OpenStudy (anonymous):

i want to write phoneBook program in java and i have arraylist of contacts and want to sort by last name what should i do ?

OpenStudy (microbot):

is it a 2-dimentional array?

OpenStudy (anonymous):

array?

OpenStudy (microbot):

ye sry doesnt matter xD read wrong :P

OpenStudy (microbot):

do you have some code to share so i can help you ? (not sure i can but i can try :P)

OpenStudy (anonymous):

i mean arraylist have some methods like get, set, add, any exist for sorting an object by one of it' elements?

OpenStudy (microbot):

the sort method if i am not wrong...or you could override the existing sorting method and make your own.

OpenStudy (anonymous):

You need to implement a sorting algorithm on the arraylist... Like a bubble sort on the last name.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!