All Exams Test series for 1 year @ ₹349 only
Question

How to express that some person keeps animals as pets ?

This question was previously asked in
UGC NET 2014 Paper 1 Question Paper (28-Dec-2014)
The correct answer is

In a UML class diagram the two kinds of things are classes (Person, Animal) and the relationship between them is an association line. A role name written at one end of the line tells what part the class at that end plays, and the multiplicity written at the same end tells how many objects of that class take part.

The four diagrams: in A and B the classes are Person and Animal, joined by a plain line with 0..* at the Animal end; in A the label pet is written below the line, apart from the multiplicity, while in B pet and 0..* are written together above the line at the Animal end. In C the classes are Person and Pet with the label animal at the Pet end. In D the classes are Person and Animal, 0..* sits at the Person end and the line carries the association name 'keep pet as' with a reading arrow.

The required meaning is: a person has zero or more animals, and those animals play the role of pet. Diagram B states exactly this, with the role name and its multiplicity written together as one end label at the Animal end, read as 'a Person has 0..* Animals in the role pet'.

Diagram C is wrong because Pet is only a role an animal plays, not a separate class, and it swaps the role name. Diagram D places 0..* at the Person end, so it counts persons per animal, and uses an association name instead of a role name for pet. Diagram A separates the role label from its multiplicity, so it does not present them as a single end label in the standard way.

Hence, the answer is option B.

Was this answer helpful?

Similar Questions

  1. What is true about UML stereotypes ?

  2. Which of the following is/are correct with reference to Abstract class and interface ?

    (a) A class can inherit only one Abstract class but may inherit several interfaces.

    (b) An Abstract class can provide complete and default code but an interface has no code.

    Codes :

  3. Match the following with reference to object oriented modelling :

    List - IList - II
    (a) Polymorphism(i) Picking both operator and attributes with operations appropriate to model an object
    (b) Inheritance(ii) Hiding implementation details of methods from users of objects
    (c) Encapsulation(iii) Using similar operations to do similar things
    (d) Abstraction(iv) Create new classes from existing class

    Codes :

  4. Which of the following is used to make an Abstract class ?

  5. Match the following w.r.t. programming languages :

    List - IList - II
    (a) JAVA(i) Dynamically object oriented
    (b) Python(ii) Statically Non-object oriented
    (c) Prolog(iii) Statically object oriented
    (d) ADA(iv) Dynamically non-object oriented

    Codes :

  6. In C++, which system - provided function is called when no handler is provided to deal with an exception ?

  7. Consider the following two statements :

    (a) A publicly derived class is a subtype of its base class.

    (b) Inheritance provides for code reuse.

    Which one of the following statements is correct ?

  8. Module design is used to maximize cohesion and minimize coupling. Which of the following is the key to implement this rule ?

  9. When the inheritance is private, the private methods in base class are __________ in the derived class (in C++).

  10. Which of the following is incorrect in C++ ?


Important Questions from OOPs concept

  1. Which statements is correct regarding main () function in C++?

    I. It is a user defined function.

    II. It is a pre-defined function.

  2. Consider the following segment of C++ code.

    int j, n;

    for(j=1;j<=n; )

    j=j*2;

    What is the number of comparisons made in the execution of the loop for any n > 0?

  3. Given below are two statements:

    Statement (I): The friend function and the member functions of a friend class directly access the private and protected data.

    Statement (II): The friend function can access the private data through the member functions of the base class

    In the light of the above statements, choose the most appropriate answer from the options given below:

  4. If a constructor 'Date' is declared explicitly and has to be defined outside the class, which of the following is correct?

  5. Which of the following statements is TRUE ?

Need Expert Advice?
Upcoming Exams
CTET
December 12, 2026
Test Series
UGC NET img
Teaching
UGC NET (Paper 2) 2026 Mock Test Series
796 Tests 2 Tests Free
4.4(39)
English
More Questions from UGC NET

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App