0

Someone to show me a way to import java util.scanner

16th Apr 2023, 9:51 AM
Thadei
Thadei - avatar
3 Answers
+ 3
Thadei import java.util.Scanner; that means you need to import the package of Scanner Why we need to import this package? Because if take user input then it's need to import the package of Scanner and also define the Scanner class, full detail please learn the course 'Introduction to Java'.
16th Apr 2023, 10:13 AM
Sakshi [Offline 🙃]
Sakshi [Offline 🙃] - avatar
+ 2
Write the import statement at the beginning of your code. import java.util.Scanner; This is covered in the Control Flow chapter of the introduction to Java course. Pay attention to lowercase/uppercase letters, they can be a common source of errors.
16th Apr 2023, 10:02 AM
Tibor Santa
Tibor Santa - avatar
+ 1
import java.util.Scanner; That line imports scanner Place it at the first line of your code. Later you can use it like this: Scanner scanner = new Scanner(System.in); int variable = scanner.nextInt(); Use sololearn course to learn that https://www.sololearn.com/Course/java-introduction/?ref=app
16th Apr 2023, 10:05 AM
Ugulberto SĂĄnchez
Ugulberto SĂĄnchez - avatar