Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

type Map does not take parameters ?

Thread view: 
Burkhard Hassel - 09 Aug 2006 18:57 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.