mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-19 17:54:42 +08:00
Closing scanners.
This commit is contained in:
@ -22,5 +22,6 @@ class TowerOfHanoi {
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
int numberOfDiscs = scanner.nextInt(); //input of number of discs on pole 1
|
||||
shift(numberOfDiscs, "Pole1", "Pole2", "Pole3"); //Shift function called
|
||||
scanner.close();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user