Exercise 3 (page 2)Make an executable class called Exercise3, with main method create 3 objects of type Animal called animal1, animal2, animal3 assign animal1 type Dog, age 3; increment age using set/get; ask to talk assign animal2 type Cat, age 4; decrement age using set/get; ask to talk ask animal3 to talk display true/false for: 1) animal1 of type Animal; 2) animal2 of type Dog display who is oldest, animal1 or animal2
Dog at age 4 says... WUF-WUF! Cat at age 3 says... MIEW-MIEW! unknown type at age 0 says... animal1 of same type as Animal: true animal2 of same type as Dog: false Comparing animal1 and animal2: 1