im using eclipse helios and i seem to not have the .scanner function, can someone please help

Recommended Answers

All 5 Replies

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

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

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.

commented: Thanks for "smallest piece of code"... +1

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.

commented: Top quality post with solid suggestions :) +8

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.

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.