Using Objects


Using Objects based on Existing Classes

BunnyHarness.java depends on a class Bunny.

Deitel Chapter 3


Classwork


Part A

Create a project and in it a class with a main, TwoAnimals.

  Copy my Bunny class and Cat class into your project.  Except for fixing the package statements you do not need to edit anything in these files to do this classwork.  In fact, reading them will probably just be confusing -- they have material we will cover later.  They are just there so you can use use Bunny and Cat objects your program 

 For information about the variables and methods in these classes look at Bunny Documentation and Cat Documentation

  In your main method:

You can base this code on the example in BunnyHarness but for the Bunny variable name and Bunny's name, use values different from in the example. Remove any code copied from the example that you don't use.

Make sure your program runs okay.
Part B

  Continuing in main  after the code you wrote earlier,

This code will be very much like what you did above with the Bunny.