All pastes #344741 Raw Edit

Anonymous

public java v1 · immutable
·published 2007-02-07 23:59 UTC
rendered paste body
import java.lang.Comparable;public class Person implements Comparable<Person> {	private String fname;	private String lname;	private int age;		public Person(String fname, String lname, int age) {		this.fname = fname;		this.lname = lname;		this.age = age;	}		public String getFirsname() {		return fname;	}		public String getLastname() {		return lname;	}		public int getAge() {		return age;	}		public int compareTo(Person p) {		return this.getAge()-p.getAge();	}}