Simply just pass an index parameter. Than you use that index to modify the element which is on position index. In order to change a certain value in the list you can use the list.set(index, element);
(in your case the element is string) function.
public static void modify(int index)
{
string nextName = kb.getStringFromUser("Enter name: ");
list.set(index, nextName);
}