Why do we have to create a new object "myObj" referring to the input stream but not just using Scanner.nextLine() directly? Example from tutorial
If the nextLine() method is from the imported package, can't we just call it as predefined method whenever (just like "printf" function in C)?
I understand that both works but just want to learn the logic behind creating a new object instead. Thanks