Question: 5 points 4. Based on the below interface and classes declarations, which of the following statement is ALLOWED (does not produce a compiler error or

 5 points 4. Based on the below interface and classes declarations,

5 points 4. Based on the below interface and classes declarations, which of the following statement is ALLOWED (does not produce a compiler error or a runtime exception)? One or more answers may be correct. interface Animal{ } class Pet { } class Cat extends Pet implements Animal { } class Dog extends Pet implements Animal { } class WildAnimal implements Animal { } class Puppy extends Dog { } public class Pet Party { } PetParty Pet> party1 = new PetPartyPet>0; PetParty Cat> party2 = new PetParty Cat>(); 0 PetPartyDog> party3 = new PetParty Dog>0; PetParty Animal party4 = new PetParty Animal>0; PetParty0; PetParty party6 = new PetParty-WildAnimal>0; 5 points 5. Based on the below interface and classes declarations, which of the following statement is NOT ALLOWED (produces a compiler error or a runtime exception)? One or more answers may be correct. interface Animal { } class Pet { } class Cat extends Pet implements Animal { } class Dog extends Pet implements Animal{ } class WildAnimal implements Animal { } class Puppy extends Dog{ } public class AnimalParty { } AnimalParty party1 = new AnimalPartyO; AnimalPartyCat> party2 = new AnimalParty0; AnimalParty Dog> party3 = new AnimalParty Dog>0; AnimalParty Animal> party4 = new AnimalParty Animal>(); AnimalParty party5 = new AnimalParty Puppy>0; AnimalParty Wild Animal> party6 = new AnimalParty WildAnimal>0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!