LRoling Posted October 14, 2004 Share Posted October 14, 2004 Any clue why the hell this is happening? import java.util.*; And it says it is never used even though I used it. Scanner is highlighted saying it is not a type. Link to comment Share on other sites More sharing options...
0 davemania Posted October 14, 2004 Share Posted October 14, 2004 maybe you imported another package that has a scanner class as well can you show your code Link to comment Share on other sites More sharing options...
0 LRoling Posted October 14, 2004 Author Share Posted October 14, 2004 import java.util.*; public class ValidateCheck { public static void main(String[] args) { System.out.println("Enter a 10-digit check number:"); Scanner sc = new Scanner (System.in); String number = sc.next(); int zeroCount = 0, nonZeroCount = 0; int index = number.length(); Just some of the code, but the lines: import java.util.*; Scanner sc = new Scanner (System.in); Those lines are problems since it says it never uses java.util.* and the Scanner is not resolved or is not a type. Link to comment Share on other sites More sharing options...
0 Mouton Posted October 14, 2004 Share Posted October 14, 2004 Dunno where u saw a Scanner class in the java.util package... It's not in my JRE (1.4.2). BTW, don't write import manually. In Eclipse, hit Crl-Shift-o and it will automatically import all needed packages, and ask you if multiple choices are available. For example, in my Eclipse, there are 2 Scanner classes: one in java_cup.runtime and one in org.apache.batik.css.parser Link to comment Share on other sites More sharing options...
0 Emon Posted October 14, 2004 Share Posted October 14, 2004 Dunno where u saw a Scanner class in the java.util package... It's not in my JRE (1.4.2).BTW, don't write import manually. In Eclipse, hit Crl-Shift-o and it will automatically import all needed packages, and ask you if multiple choices are available. For example, in my Eclipse, there are 2 Scanner classes: one in java_cup.runtime and one in org.apache.batik.css.parser 584732873[/snapback] its in 1.5 .. did you have 1.4 installed before ? maybe your Eclipse is still using that. Check what libraries it is using. Link to comment Share on other sites More sharing options...
Question
LRoling
Any clue why the hell this is happening?
import java.util.*;
And it says it is never used even though I used it.
Scanner is highlighted saying it is not a type.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts