This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes (T) in Pair<T> cannot be applied to (Pair<T>) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "(T) in Pair<T> cannot be applied to (Pair<T>)" Watch "(T) in Pair<T> cannot be applied to (Pair<T>)" New topic
Author

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

Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 662



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


Jon
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14961
    
  26

Look closely at what you're trying to pass to setSecond() in line 25. Does that match what the setSecond method expects or not?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 662

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..
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: (T) in Pair<T> cannot be applied to (Pair<T>)
 
It's not a secret anymore!