171k views
2 votes
consider this class: class family{ string firstname; int age; string family name; } // which variable supposed to be static?

User Bnaecker
by
9.1k points

1 Answer

1 vote

Final answer:

The 'family name' variable should be static in the family class, as it's a common attribute shared by all family members.

Step-by-step explanation:

In the provided class family, the variable that is supposed to be static is likely the family name. This is because while each member of the family will have a unique first name and age, they typically share the same family name. Therefore, making the family name static will apply it to all instances of the family class, reflecting this common attribute among family members.

User Stack Questions
by
7.9k points