Rhino - /* I looked carefully at the specifications...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/** I looked carefully at the specifications produced by clicking the javadoc button and * checked that the specifications of methods and the class specification were OK */ /** This is a class representing rhinos*/ public class Rhino { private String name; // Name of the rhino private char gender; // Gender of the rhino private int month; // Month of birth of the rhino (m is integers from 1 to 12) private int year; // Year of birth of the rhino (y is integers from 1857 to 2005) private int tag; // Tag number of the rhino (-1 if not tagged) private Rhino father; // Father of this rhino (null if unknown) private Rhino mother; // Mother of this rhino (null if unknown) private int children; // Number of rhinos that have this one as a parent /**Constructor: a new Rhino. Parameters are, in order, the name of the rhino, * the month and year of birth, and its gender. The new rhino is not tagged, * its parents are not known, and gender is 'F' or 'M'. It has no children. */ public Rhino (String name, int month, int year, char gender) {
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 04/19/2011.

Page1 / 3

Rhino - /* I looked carefully at the specifications...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online