+1 vote
in Software Architecture by (75.2k points)
Which of the following is correct?

(a) An attribute is a class variable when each object stores its own value for the attribute

(b) An attribute can also be an instance variable,  which means that there is only one value stored for the attribute that is shared by all class instances

(c) An instance operation can be called using any object

(d) A class operation is encapsulated in a class and can be called through the class

This question was addressed to me during a job interview.

Enquiry is from Advanced UML Class Diagrams in chapter Unified Modelling Language of Software Architecture

1 Answer

0 votes
by (46.2k points)
Correct answer is (d) A class operation is encapsulated in a class and can be called through the class

The explanation is: An attribute is an instance variable when each object stores its own value for the attribute whereas an attribute can also be a class variable,  which means that there is only one value stored for the attribute that is shared by all class instances and An instance operation can be called only by using instance.

Related questions

We welcome you to Carrieradda QnA with open heart. Our small community of enthusiastic learners are very helpful and supportive. Here on this platform you can ask questions and receive answers from other members of the community. We also monitor posted questions and answers periodically to maintain the quality and integrity of the platform. Hope you will join our beautiful community
...