Skip to content

Commit 49d5566

Browse files
committed
Update Account.java
Fixed the indentation with the right level
1 parent 956906c commit 49d5566

File tree

1 file changed

+14
-19
lines changed
  • src/com/codefortomorrow/advanced/chapter14/solutions

1 file changed

+14
-19
lines changed

src/com/codefortomorrow/advanced/chapter14/solutions/Account.java

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -79,29 +79,24 @@ public static void main(String[] args) {
7979
}
8080
}
8181

82-
public static void createAccount(
83-
String username,
84-
int age,
85-
String password,
86-
String confirmPassword
87-
)
82+
public static void createAccount(String username, int age, String password, String confirmPassword)
8883
throws InvalidAgeException, InvalidPasswordException, InvalidUsernameException, PasswordMismatchException {
89-
if (username.length() < 4 || username.length() > 10) {
90-
throw new InvalidUsernameException();
91-
}
84+
if (username.length() < 4 || username.length() > 10) {
85+
throw new InvalidUsernameException();
86+
}
9287

93-
if (age < 18) {
94-
throw new InvalidAgeException();
95-
}
88+
if (age < 18) {
89+
throw new InvalidAgeException();
90+
}
9691

97-
if (password.length() < 4 || password.length() > 10) {
98-
throw new InvalidPasswordException();
99-
}
92+
if (password.length() < 4 || password.length() > 10) {
93+
throw new InvalidPasswordException();
94+
}
10095

101-
if (!password.equals(confirmPassword)) {
102-
throw new PasswordMismatchException();
103-
}
104-
}
96+
if (!password.equals(confirmPassword)) {
97+
throw new PasswordMismatchException();
98+
}
99+
}
105100
}
106101

107102
class InvalidUsernameException extends Exception {}

0 commit comments

Comments
 (0)