Skip to content

Проектная работа №1 - #1

Open
Maikl730 wants to merge 4 commits into
mainfrom
dev
Open

Maikl730 wants to merge 4 commits into
mainfrom
dev

Conversation

@Maikl730

Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/main/java/Car.java Outdated
Comment on lines +2 to +3
String name;
int speed;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Поля лучше пометить final, тем самым исключив возможность их модификации извне

Comment thread src/main/java/Main.java Outdated
System.out.println("Hello world!");

Scanner scanner = new Scanner(System.in);
ArrayList<Car> cars = 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.

От хранения массива машин и лишнего цикла при определении победителя можно избавиться, если при вводе данных сразу вычислять победителя и хранить его в отдельной переменной, тогда программа будет требовать меньше памяти и работать быстрее

Comment thread src/main/java/Main.java Outdated
Comment thread src/main/java/Main.java Outdated
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