Closing scanners.

This commit is contained in:
Hassan
2020-01-28 18:34:52 +02:00
parent 4f45c5a479
commit a1f59c38b1
27 changed files with 29 additions and 4 deletions

View File

@@ -20,6 +20,7 @@ public class PowerOfTwoOrNot {
} else {
System.out.println("Number is not a power of two");
}
sc.close();
}
@@ -32,5 +33,4 @@ public class PowerOfTwoOrNot {
public static boolean checkIfPowerOfTwoOrNot(int number) {
return number != 0 && ((number & (number - 1)) == 0);
}
}