Which of the following is correct?
A. An attribute is an class variable when each object stores its own value for the attribute
B. An attribute can also be a 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
Answer:A
Which of the following is correct?
A. An attribute is an class variable when each object stores its own value for the attribute B. An attribute can also be a 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
Explanation: 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.