[Java] 객체지향(2) 연습 정리
2020. 7. 11.
회원이 대여한 비디오 출력 예제(캡슐화) Video.java public class Video { //video 관련 멤버변수 private String num; private String title; private String actor; //디폴트 생성자 public Video() {} public Video(String num, String title, String actor) { this.num = num; //this는 클래스 자기 자신을 가르킨다. this.title = title; //지역변수를 멤버변수에 대입 this.actor = actor; } //getter, setter 메서드 public String getNum() { return num; } public void setNum(S..