mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-27 14:34:05 +08:00
style: enable NeedBraces
in checkstyle (#5227)
* enable style NeedBraces * style: enable NeedBraces in checkstyle --------- Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
This commit is contained in:

committed by
GitHub

parent
51fcc66345
commit
87b17e0571
@ -14,7 +14,9 @@ public final class HarshadNumber {
|
||||
* {@code false}
|
||||
*/
|
||||
public static boolean isHarshad(long n) {
|
||||
if (n <= 0) return false;
|
||||
if (n <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
long t = n;
|
||||
long sumOfDigits = 0;
|
||||
@ -35,7 +37,9 @@ public final class HarshadNumber {
|
||||
*/
|
||||
public static boolean isHarshad(String s) {
|
||||
final Long n = Long.valueOf(s);
|
||||
if (n <= 0) return false;
|
||||
if (n <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int sumOfDigits = 0;
|
||||
for (char ch : s.toCharArray()) {
|
||||
|
Reference in New Issue
Block a user