배열 응용 프로그램

반응형

    JAVA Basic) 배열 응용 프로그램

    목차 ArrayList를 사용해 '학생 성적 출력 프로그램'을 구현해보자. 이 프로그램은 'Student클래스'와 'Subject클래스'를 사용한다. Subject클래스는 참조 자료형이므로 ArrayList를 활용해 구현해보자. student클래스 구현하기 어떤 학생이 수강하는 과목들의 성적을 출력하는 것이므로 '학생 객체'가 필요. package array; import java.util.ArrayList; public class Student { int studentID; String studentName; ArrayList subjectList; // Student클래스의 멤버 변수들 public Student(int studentID, String studentName) { this.student..

반응형