replace(String,String) method for string arraylist in java code example Example: modify element in list java list.set( 2, "New" );