7 Years
Discussion Span
Last Post by extemer

Are you sure that you typed it in as import java.util.[B][U]S[/U][/B]canner; ? ('Scanner' starts with a capital letter).


In case you're still encountering problems with it, after applying the suggestions already given, then post the smallest piece of code that is able to reproduce your problem.

Votes + Comments
Thanks for "smallest piece of code"...

Or simply put the header as:
import java.util.*;

importing java.util.* is seen as bad form in some circles. Generally it's good to make your imports explicit so it's obvious what you're using; this way the import statements are informative to the coder who comes after you.
("I can see you using ArrayList and Scanner", versus "I can see you use some utility classes")

In the case of java.util, it's also problematic to import the whole package if you're also using java.awt.* because both packages have classes called "List" - you get an import conflict, so if you want to use one or the other List class, you have to use the fully qualified name.

Votes + Comments
Top quality post with solid suggestions :)

What JDK are you using? Eclipse out of the repositories using the GNU java compiler, libraries and interpreter and these are different then the standard Sun Java JDK. So it would I would guess not being able to open a standard class is because of this.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.