Skip to content

hw26#15

Open
VS-Ivanov wants to merge 2 commits into
masterfrom
hw26
Open

hw26#15
VS-Ivanov wants to merge 2 commits into
masterfrom
hw26

Conversation

@VS-Ivanov
Copy link
Copy Markdown
Owner

No description provided.

if(box == null) {return false;}
if(box == this) {return true;}

return ((this.weight() - box.weight()) == 0);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Если вес инт то проще напрямую сравнивать


//пересыпаем фрукты из текущей коробки в другую
public void transfer(Box<? super T> box) {
for(T fruit: fruits) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Если box == нулл или this, то будут проблемы

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