| Author |
Using MAp Problem
|
Mohit G Gupta
Ranch Hand
Joined: May 18, 2010
Posts: 634
|
|
ToDos CLass is defined and it extends Comparator
The above gives the following error:
type Map does not take parameters
{ Map<ToDos,String> m=new TreeMap<ToDos,String>()
can anyone tell why ?
|
OCPJP 6.0 93%
OCPJWCD 5.0 98%
|
 |
Malatesh Karabisti
Ranch Hand
Joined: Jul 28, 2010
Posts: 143
|
|
I think you are using IDE. try compiling using command and post the exact error message.I didn't get any error for following code. by the way what is the version of your JDK ?
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3793
|
|
|
The Java version is the first thing I'd check. If it's 1.4 or earlier then it won't understand generics.
|
 |
Mohit G Gupta
Ranch Hand
Joined: May 18, 2010
Posts: 634
|
|
i am using jcreator lite
jdk 1.6
|
 |
Prabhakar Reddy Bokka
Ranch Hand
Joined: Jul 26, 2005
Posts: 189
|
|
Mohit,
The code posted by Malatesh works perfectly alright. Did you tried??
|
SCJP 5, SCWCD 5
|
 |
Hebert Coelho
Ranch Hand
Joined: Jul 14, 2010
Posts: 754
|
|
|
Which error are you getting?
|
[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
|
 |
Shanky Sohar
Ranch Hand
Joined: Mar 17, 2010
Posts: 1046
|
|
it may be possible that you will be having a same class in the same package with the same name.i.e ToDOs.
So compiler is taking that class intead of the one which is implementing the comparator.
Have a check..Otherwise code should work fine
|
SCJP6.0,My blog Ranchers from Delhi
|
 |
 |
|
|
subject: Using MAp Problem
|
|
|