Labrador - super(name this.color = color Big bark overrides...

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

View Full Document Right Arrow Icon
// **************************************************************** // // // A class derived from Dog that holds information about // a labrador retriever. Overrides Dog speak method and includes // information about avg weight for this breed. // // **************************************************************** public class Labrador extends Dog { private String color; //black, yellow, or chocolate? private int breedWeight = 75; public Labrador(String name, String color)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { super(name); this.color = color; } // ------------------------------------------------------------// Big bark -- overrides speak method in Dog // ------------------------------------------------------------public String speak() { return "WOOF"; } // ------------------------------------------------------------// Returns weight // ------------------------------------------------------------public int avgBreedWeight() { return breedWeight; } }...
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