| 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
|
|
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!
|
 |
 |
|
|
subject: error initializing hashmap
|
|
|