What's wrong with this code its throwing run time error

@Narasimha,
https://ide.geeksforgeeks.org/GCJKUjEqR2 Here is your corrected code.
Use only 1 scanner class object. I passed the object you created in main method to the generic tree class as argument.