Good day all, am new here, probably don't know if am doing it right. My import.java.util.Scanner is not working on my intelliJ IDEA, thanks in advance!!

input_error_2.jpg

input_error_1.jpg

Recommended Answers

All 3 Replies

I don't know Java, but are you importing java.util.Scanner or java.util.*?

Try adding import java.util.*; at the top of your code.

Yes, definitely a missing import.
In general we would advise against importing whole libraries (eg. import java.util.* ) because you are adding a huge number of names that you don't know to your namespace. That can lead to really baffling errors when a name clashes (eg awt.List vs util.List), or even worse when you accidentally mis-spell a name and make a valid reference to some random class in java.util

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.