public String[] getStudents() {
return Arrays.copyOf(students, students.length);;
}
public String[] getStudents() {
String[] copyStudents = new String[students.length];
System.arraycopy(students, 0, copyStudents, 0, students.length);
return copyStudents;
}
3 clone
public String[] getStudents() {
return students.clone();
}
Also see the answer about performance of each approach. They are pretty the same