Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Консольное приложение No1#1

Open
exMarsianin wants to merge 3 commits intomain from
dev
Open

Консольное приложение No1 #1
exMarsianin wants to merge 3 commits intomain from
dev

Conversation

@exMarsianin
Copy link
Owner

@exMarsianin exMarsianin commented Oct 22, 2023

Попытка номер 2 :)

public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
Scanner scan = new Scanner(System.in);
Copy link

@i-masloed i-masloed Oct 22, 2023

Choose a reason for hiding this comment

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

Рекомендация: - хорошей практикой является делать вызов scanner.close() после того, как сканнер больше не используется. Это необходимо для того, что бы этот объект не потреблял ресурсы, тогда когда это уже не требуется.

@@ -0,0 +1,38 @@


public class Calculator {
Copy link

@i-masloed i-masloed Oct 22, 2023

Choose a reason for hiding this comment

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

В java принят определенный стиль форматирования кода. Если не вдаваться в подробности, то отформатировать код можно быстрой комбинаций клавиш Ctrl+Alt+L(Windows) или (⌘+⌥+L)(Mac)

this.people = people;
}

void addmember(Product product){
Copy link

@i-masloed i-masloed Oct 22, 2023

Choose a reason for hiding this comment

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

Рекомендация: В яве и котлине принят нейминг в стиле CamelCase, т.е. лучше переименовть в addMember ( но имя метода должно быть с маленькой буквы)

}

public static String getSuffix(double rubles) {
if (rubles % 100 >= 11 && rubles%100 <= 14){
Copy link

@i-masloed i-masloed Oct 22, 2023

Choose a reason for hiding this comment

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

rubles % 100 и rubles % 10 считаются несколько раз, чтоит вынести эти значения в локальные переменные метода

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

Reviewers

1 more reviewer

@i-masloed i-masloed i-masloed left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /