Camel case.

This commit is contained in:
Rhinemann 2023-05-07 22:20:31 +03:00
parent ca2b85ef9e
commit 2494bea36c
1 changed files with 6 additions and 6 deletions

View File

@ -2,19 +2,19 @@ import java.util.Scanner;
public class lab_1 { public class lab_1 {
public static int protectedInput(String variable_to_read, Scanner input) { public static int protectedInput(String variableToRead, Scanner input) {
int read_variable; int readVariable;
do { do {
try { try {
System.out.printf("Enter %s: ", variable_to_read); System.out.printf("Enter %s: ", variableToRead);
read_variable = input.nextInt(); readVariable = input.nextInt();
break; break;
} catch (Exception e) { } catch (Exception e) {
System.out.printf("%s must be an integer.\n", variable_to_read.toUpperCase()); System.out.printf("%s must be an integer.\n", variableToRead.toUpperCase());
input.nextLine(); input.nextLine();
} }
} while (true); } while (true);
return read_variable; return readVariable;
} }
public static void main(String[] args) { public static void main(String[] args) {