Skip to content

Init commit#1

Open
rogovas1 wants to merge 2 commits into
mainfrom
dev
Open

Init commit#1
rogovas1 wants to merge 2 commits into
mainfrom
dev

Conversation

@rogovas1
Copy link
Copy Markdown
Owner

@rogovas1 rogovas1 commented Oct 9, 2025

No description provided.

Comment thread src/main/java/Main.java Outdated
while (true) {
System.out.println("Скорость автомобиля от 0 до 250 км/ч");
speed = scanner.nextInt();
if (speed > 0 && speed <= 250) {
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
int speed;
while (true) {
System.out.println("Скорость автомобиля от 0 до 250 км/ч");
speed = scanner.nextInt();
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
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