Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Jon Camilleri
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
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15860
80
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..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!