In this tutorial myObj was being created as a new object referring to the input stream Scanner(System.in)
I have a question on that - why can't we just use Scanner.nextLine() whenever we want to get user input if this is predefined method in package imported (similar to printf in C)?
Why do we have to create a new object to get user input but not use Scanner.nextLine() directly?
in Java/JSP/J2EE
Posted
In this tutorial myObj was being created as a new object referring to the input stream Scanner(System.in)
I have a question on that - why can't we just use Scanner.nextLine() whenever we want to get user input if this is predefined method in package imported (similar to printf in C)?
Thanks