Skip to content

Pull request для проектной работы №1 - #1

Open
dreygoff wants to merge 2 commits into
mainfrom
dev
Open

dreygoff wants to merge 2 commits into
mainfrom
dev

Conversation

@dreygoff

@dreygoff dreygoff commented Jun 6, 2023

Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/main/java/Main.java




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

public static int getInt(Scanner scan) {
try {
int number = scan.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.

У Scanner есть удобный метод hasNextInt, можно сразу узнать без дополнительных проверок возможно ли интерпретировать строку как int

Comment thread src/main/java/Main.java

public static float getFloat(Scanner scan) {
try {
float number = scan.nextFloat();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Тоже самое только hasNextFloat

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