Trio - } private A first private A second private A third...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 public class Trio <A>{ public Trio(A a, A b, A c){ first = a second = b third = c } public A first(){ return first } public A second(){ return second } public A third(){ return third } public String toString() { return "<" + first.toString() + ", " + second.toString() + ", " + third.toString() + ">"
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } private A first private A second private A third public static void main(String args) { Trio&lt;String&gt; tester = new Trio&lt;String&gt;(&quot;abc&quot;,&quot;def&quot;,&quot;ghi&quot;) System.out.println(&quot;Show Results:&quot; + tester.toString()) } }...
View Full Document

This note was uploaded on 09/16/2009 for the course CS 3345 taught by Professor Ozbirn during the Spring '08 term at University of Texas at Dallas, Richardson.

Ask a homework question - tutors are online