summaryrefslogtreecommitdiff
path: root/src/example/java/bjc
diff options
context:
space:
mode:
Diffstat (limited to 'src/example/java/bjc')
-rw-r--r--src/example/java/bjc/funcdata/bst/BinarySearchTreeExample.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/example/java/bjc/funcdata/bst/BinarySearchTreeExample.java b/src/example/java/bjc/funcdata/bst/BinarySearchTreeExample.java
index 9be96be..258b17d 100644
--- a/src/example/java/bjc/funcdata/bst/BinarySearchTreeExample.java
+++ b/src/example/java/bjc/funcdata/bst/BinarySearchTreeExample.java
@@ -64,11 +64,9 @@ public class BinarySearchTreeExample {
* Unused CLI args
*/
public static void main(final String[] args) {
- final Scanner input = new Scanner(System.in);
-
- runExample(input, System.out);
-
- input.close();
+ try (Scanner input = new Scanner(System.in)) {
+ runExample(input, System.out);
+ }
}
private static void runExample(final Scanner input, OutputStream outpt) {