• Post Reply Bookmark Topic Watch Topic
  • New Topic

(T) in Pair<T> cannot be applied to (Pair<T>)  RSS feed

 
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Error

C:\Documents and Settings\Jon\workspace\JavaDev\corejava8\v1ch12\PairTest1\Pair.java:25: setSecond(T) in Pair<T> cannot be applied to (Pair<T>)
p.setSecond(p);
^
1 error




Core Java Vol I (8th Ed) chp 12 p.637
 
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look closely at what you're trying to pass to setSecond() in line 25. Does that match what the setSecond method expects or not?
 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:Look closely at what you're trying to pass to setSecond() in line 25. Does that match what the setSecond method expects or not?



Oops..
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!