Null Pointer Exception 나올거 같은 소스네요.
그리고 메소드가 아니고 클래스로 구현되있네요 ㄷㄷ.. 저는 일단 메소드 형식으로 바꿔서 알려드릴게요.
2가지 방법을 제시 해드릴 수 있는데 원하는 방향으로 구현해보세요.
1안 먼저 arrlist를 만든 후 그곳에 데이터만 채워넣는다.
private ArrayList<Student> copyStudent(ArrayList<Student> arrList){
ArrayList<Student> temp = arrList;
Student sTemp;
sTemp = new Studnet("홍길동", "20");
temp.add(sTemp);
retrun temp;
}
2안 새로운 리스트를 만들어 데이터를 넣는다
private ArrayList<Student> copyStudent(){
ArrayList<Student> temp = new ArrayList<Student>();
Student sTemp;
sTemp = new Studnet("홍길동", "20");
temp.add(sTemp);
retrun temp;
}
개인적으로는 1안을 주로 사용합니다.