what is import java.io.*? 1

what is import java.io.*?

Import basically means you're adding a Library/Package full of classes and methods that are premade for ease of use. Java.IO is standard for Java Input/Output. So in essence you're importing extra Input/Output functionality. The asterisk on the end means you're importing everything in the Java.IO Package.

Here is what the above code is Doing:
1. We’re creating a new instance of the Scanner class.
2. We’re calling the nextLine() method on the Scanner class.
3. We’re assigning the value of the nextLine() method to the variable name.

Similar Posts