Skip to content

Lesson20 - #26

Open
Safer68 wants to merge 1 commit into
masterfrom
Lesson20
Open

Lesson20#26
Safer68 wants to merge 1 commit into
masterfrom
Lesson20

Conversation

@Safer68

@Safer68 Safer68 commented Jan 16, 2022

Copy link
Copy Markdown
Owner

No description provided.

@Safer68

Safer68 commented Jan 16, 2022

Copy link
Copy Markdown
Owner Author

Comment thread src/Lesson20/Task57.java
public class Task57 {
public static final List<Integer> list = new ArrayList<>();

private static int s = 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.

если у нас есть статическая переменная то жто в 99% случаев константы

Comment thread src/Lesson20/Task57.java
public static final List<Integer> list = new ArrayList<>();

private static int s = 0;
private static final int limit = 10000;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

как пишем название констант?

Comment thread src/Lesson20/Task57.java
e.printStackTrace();
}
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

после wait ничего не надо делать?

Comment thread src/Lesson20/Task57.java
}
}
if (list.size() <= 80) {
list.notifyAll();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

он в конце идти должен

Comment thread src/Lesson20/Task57.java
}

private static void startManufacturer() {
while (s < limit) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

сделай проще 10000 элементов добавь

Comment thread src/Lesson20/Task57.java
}

private static void startConsumer() {
while (s < limit) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

10000 элементов удали

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