+ 2
Scanner
import java.util.*; //you can use that star * instead of Scanner and it does the same job class MyClass { public static void main(String[ ] args) { Scanner myVar = new Scanner(System.in); System.out.println(myVar.nextLine()); } }
1 Respuesta
+ 3
Yes, you are correct.
This symbol * indicates to import all the available classes, objects, methods and properties in that package. It is necessary only when you need many of them from a single one package. It prevents large lengths of code and also saves time and labour. However, this may cause the program to run slow. In that case, you need to import all of them one by one!