Comparable - cannot be applied to (int,int,int)

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Solution to Using the Comparable Interface Completed Compare3 class: Compare3.java Completed Comparisons program: Comparisons.java In Java 1.4, attempting to pass ints to Compare3.largest gives the following error message: Comparisons.java:18: largest(java.lang.Comparable,java.lang.Comparable,java.lang.Comparable) in Compare3
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cannot be applied to (int,int,int) System.out.println("The largest is " + Compare3.largest(num1, num2, num3)); In Java 1.5, however, it compiles and runs correctly because autoboxing make an explicit int->Integer unnecessary....
View Full Document

This note was uploaded on 03/22/2010 for the course CS 202 taught by Professor Fong during the Spring '10 term at SIU Carbondale.

Ask a homework question - tutors are online