Hi there. I've attached some code for my program in which I have to enter a series of usernames and passwords, add them to a binary search tree and print them out. I have only ever used input from a text file or in the main method, but for the next part I have to input the usernames and passwords at the command line. Can anyone help me out, perhaps show me which parts to modify? Thanks.
The Scanner class JavaDoc actually uses reading input from System.in (console input) as one of the examples. It is similar to reading from a file. The biggest difference is that you'll want to alternate:
prompt for user id
read user id
prompt for password