Robert and Heller's self
test: #4
You have been given a design document for a veterinary registration system for implementation in
Java. It states: "A pet has an owner, a registration date, and a vaccination-due date. A cat is a pet that has a flag indicating if it has been neutered, and a textual description of its markings." Given that the Pet class has already been defined and you expect the Cat class to be used freely throughout the application, how would you make the opening declaration of the Cat class, up to but not including the first opening brace? Use only these words and spaces: boolean, Cat, class, Date, extends, Object, Owner, Pet, private, protected, public,
String.
My answer is :
public class Cat extends Pet {private boolean b; private String m;}
I do not understand the feedback answer which is following
Question 4:
Your response is incorrect
public class Cat extends Pet The class should be public since it is to be used freely throughout the application. The statement "A cat is a pet" tells us that the Cat class should subclass Pet. The other words offered are required for the body of the definitions of either Cat or Pet--for use as member variables--but are not part of the opening declaration.
please give me a help!
yd