Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why this is not working(subclass to superclass).

 
Ritesh raushan
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
at compile time gives error.but i think that Object is a super class he takes all sub class object .

error-
method set in class Manager cannot be applied to given types;
m.set("ritesh");
^
required: Object
found: String
reason: actual argument String cannot be converted to Object by method invocation conve
rsion

 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most likely explanation is you actually have your own Object class hanging around somewhere in the same package (either as source code or a compiled code). If you can't find it, try changing all the references to java.lang.Object and see if that changes the result.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic