Mansukhdeep Thind wrote:
Alan Anderson wrote:Jeff I need to shift values in elements...Say i have student = "Fred", if i add Anthony to the array, since Anthony comes before Fred, i want Anthony to replace Fred at student and then move Fred to student...and all these while am adding new student record.
Campbell Ritchie wouldn't the arrayCopy require me creating another array? that is a destination array?
As I see it, you need to check the name to be added with the existing names in the array and accordingly add the new entry at the respective index position. Am I correct? Is this the exact use case Alan?
Campbell Ritchie wrote: You may need to find out about ordering objects. Fortunately the Java Tutorials has a section which covers just that.