001package edu.pdx.cs410J.j2se15; 002 003/** 004 * A tuple class that holds two generic values. Demonstrates how 005 * multiple values can be returned from a method in a type-safe manner 006 * using Java generics. 007 * 008 * @see TupleExample 009 * 010 * @author David Whitlock 011 * @since Summer 2005 012 */ 013public final class Tuple<A,B> { 014 private final A first; 015 private final B second; 016 017 public Tuple(A first, B second) { 018 this.first = first; 019 this.second = second; 020 } 021 022 public A getFirst() { 023 return this.first; 024 } 025 026 public B getSecond() { 027 return this.second; 028 } 029}