aspose file tools*
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 Java 8 in Action this week in the Java 8 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: 659



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: 13884
    
  10

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 7 API documentation
Scala Notes - My blog about Scala
Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 659

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: (T) in Pair<T> cannot be applied to (Pair<T>)
 
Similar Threads
static read-only datatype (class) as Servlet?
Descending order and associating Array Elements in sort method to another's elements
Writing RTF files from Java Swing DefaultStyledDocuments
Simple J2SE 5.0 Tiger Notes
Generic doubt :-)