Hi all,
I got a strange error message from the java 1.5.0 compiler:
"type Map does not take parameters" which Map certainly does.
The complete code was this mini class:
import java.util.*;
class AAA {
public static void main(String[] args) {
Map<Integer, String> map = new HashMap<Integer,String>();
System.out.println(map);
}
}
NB, it does not compile with the original compiler, but compiles happily
within an Eclipse 3.1 environment.
And it does also compile with the original compiler when I change the
reference type from Map to HashMap.
How can this be?
Yours,
Bu.
jagonzal@gmail.com - 09 Aug 2006 19:30 GMT
> How can this be?
Are you sure you are you are using the compiler you think you are
using? (I mean, maybe a path variable or something like that is
pointing you to another compiler in your computer).
I tried your source code and it compiled OK, javac 1.5.0_06 on linux.
Mike Schilling - 10 Aug 2006 01:57 GMT
> Hi all,
>
[quoted text clipped - 16 lines]
>
> How can this be?
Wild guess, but is there another class Map in the same package as AAA, one
that isn't generic? If so, it would be used instead of java.util.Map.