• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

has-a releations

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone give the answer and explain the same??
You have been given a design document for a veterinary registration system for implementation in Java technology. 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, which of the following fields would be appropriate for inclusion in the Cat class as members?
A. Pet thePet;
B. Date registered;
C. Date vaccinationDue;
D. Cat theCat;
E. boolean neutered;
F. String markings;
 
arch rival
Posts: 2813
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What part do you not understand?
 
Kumareswark
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want answers for this question. Please validate my answers.
My answers are D, E, F.
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought the answers are E, F.
am i right??
If not, can anyone please clarify. Thanks in advance.
Sunitha. S

Originally posted by Kumareswark:
Can anyone give the answer and explain the same??
You have been given a design document for a veterinary registration system for implementation in Java technology. 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, which of the following fields would be appropriate for inclusion in the Cat class as members?
A. Pet thePet;
B. Date registered;
C. Date vaccinationDue;
D. Cat theCat;
E. boolean neutered;
F. String markings;


 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi kumares!
what the question is asking is what should the cat class include as member variable sto complete the defn. according to the defn. the extra features of th cat class other that what define in pet class are E,F
D is not possible since in Cat MyCat , u r instantiating the class cat which ic not necessary to be the memeber var. according to the defn.
hope that's clear, any more clarificationc always welcome
Thanx
aNiL
 
Marcus Green
arch rival
Posts: 2813
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes but which part of the question did Kumareswark
not understand. What I always want to know is which part is not understood.
You can give someone the answer and they will still be no better off next time they come accross a similar question.
So Kumareswark what part of the original question did you not understand? I'm not getting at you, I just want to make sure that next time you come accross a similar question you will be able to get to the correct answer.
Marcus
Marcus
 
reply
    Bookmark Topic Watch Topic
  • New Topic