Compare3 - public static Comparable largest(Comparable x...

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

View Full Document Right Arrow Icon
//******************************************************************** // // // Provides a static method that returns the largest of 3 Comparable // parameters. //******************************************************************** public class 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: { public static Comparable largest(Comparable x, Comparable y, Comparable z) { if (x.compareTo(y) >= 0 && x.compareTo(z) >= 0) return x; else if (y.compareTo(x) >= 0 && y.compareTo(z) >= 0) return y; else return z; } }...
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