Skip to content

HomeWork 19#14

Open
ib2828 wants to merge 1 commit intomainfrom
origin/feature/homework19
Open

HomeWork 19#14
ib2828 wants to merge 1 commit intomainfrom
origin/feature/homework19

Conversation

@ib2828
Copy link
Copy Markdown
Owner

@ib2828 ib2828 commented May 8, 2025

No description provided.

}

public void clear() {
fruits = new ArrayList<>();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А почему просто у листа не вызвать бы clear(), зачем новый объект нужен? Чтобы при получении во внешнем коде ссылки случайно ее не изменить?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants