Skip to content

Java02. ДЗ 01, Васильев Роман#6

Open
nizshee wants to merge 1 commit intomasterfrom
task11
Open

Java02. ДЗ 01, Васильев Роман#6
nizshee wants to merge 1 commit intomasterfrom
task11

Conversation

@nizshee
Copy link
Owner

@nizshee nizshee commented Sep 11, 2016

}
return optional.get();
}
};

Choose a reason for hiding this comment

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

три ссылки: supplier, optional и значение внутри optional

Copy link
Owner Author

Choose a reason for hiding this comment

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

А почему значение внутри optional считается? Оно же не в Lazy объекте?

Choose a reason for hiding this comment

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

Иначе можно было написать так:

class Lazy {
    private final DataStorage ds = new DataStorage(supplier, ...)

    ...
}

и все хранить в ds

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