aspose file tools
The moose likes Beginning Java and the fly likes error initializing hashmap Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "error initializing hashmap" Watch "error initializing hashmap" New topic
Author

error initializing hashmap

leroy tsruya
Ranch Hand

Joined: Sep 24, 2009
Posts: 57
Hi all!
i keep getting errors for this line:

it says that it doesnt find Classes T and S

but these are wildcards...

Thanks!
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16689
    
  19

Wildcards are specified with a "?" question mark. You can also bound it with "extends" and "super", but even then, you need to specify with a "?".

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Shashank Rudra
Ranch Hand

Joined: Mar 26, 2009
Posts: 131
this is not how we create generic while declaring reference variables. That is when we are defining generics for classes and methods. For defining reference variables Generic in nature instead we use <?>, <? extends> and <? super>. That depends on what is our need. Those details can be found in Core java books. I would prefer to look into Kathie's book.


Programmer Analyst || J2EE web development/design
leroy tsruya
Ranch Hand

Joined: Sep 24, 2009
Posts: 57
Thank you guys, i figured my mistake.
Thanks!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: error initializing hashmap
 
Similar Threads
Stack Implementation in Java - Source Code please?
extending an arraylist\hashmap
Subclassing Hashtable with generics?
Queue Implementation in Java - Source Code please?
Linked List Implementation in Java - Source Code please?