compile time error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sindhu Rani
    New Member
    • Aug 2008
    • 4

    compile time error

    Hi, can anybody say the solution for this error.........

    C:\s\source>jav ac -d ..\classes zoo.java
    zoo.java:10: put(java.lang.O bject,java.lang .Object) in java.util.Map cannot be applied to (int,animal)
    listofAnimals.p ut(cellno++,a);
    ^
    1 error
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Try to to use a a Map<Integer, Animal> map instead. See the generics docs
    that are with us since Java 1.5

    kind regards,

    Jos

    Comment

    Working...