Exercises

   

Java™ 2 Primer Plus
By Steven Haines, Steve Potts

Table of Contents
Chapter 8.  Interfaces


Q1:

Extend the animal classes you built in the previous chapter to include two interfaces: Eating defines one method eat(), and Playing that defines one method play(). Each animal should implement these interfaces in a way that is most appropriate for them.

Create a ZooKeeper class that goes to each animal and plays with it, and then feeds it.


       
    Top
     



    Java 2 Primer Plus
    Java 2 Primer Plus
    ISBN: 0672324156
    EAN: 2147483647
    Year: 2001
    Pages: 332

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net