Skip to content

Instantly share code, notes, and snippets.

Created Apr 10, 2021
What would you like to do?
public class Movie {
private final String title;
private int availableCopies = 1;
private List<Member> onLoanTo = new ArrayList<>();
public Movie(String title){
this.title = title;
public void borrowCopy(Member member){
availableCopies -= 1;
public void returnCopy(Member member){
public String getTitle() {
return title;
public int getAvailableCopies() {
return availableCopies;
public Boolean isOnLoanTo(Member member) {
return onLoanTo.contains(member);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment