Answer the question
In order to leave comments, you need to log in
What is the name of the simplest class?
There is an object in the code, the only property of which is the duration of its existence. What is the name of the class of which this object is an instance? It is desirable to give an answer with justification - more detailed than one word.
Answer the question
In order to leave comments, you need to log in
Lifetime, because it translates as "life span", as opposed to simple "duration" and "duration".
You need to create the TimeObjectDLL library. Place the TimeObjects namespace in the library. There is one more thing inside - ConstructableObjects. Create a VariantObject class in the namespace. In this class, create another class, SingleConstructableObject. Inside create a CountableDuarationObject class. Add your Lifetime property to this class.
After compiling the library, you can create the necessary objects and access them as follows
new TimeObjects.ConstructableObjects.VariantObject.SingleConstructableObject.CountableDuarationObject().Lifetime=10
And why is he needed? What problem does it solve? Measurement of time?
There is an object in the code, the only property of which is the duration of its existence
Maybe just Timer? The meaning is suitable
Well, or even better Stopwatch (stopwatch) - just the only function - to measure the time from the moment of launch, in your case - creation
You need to name classes based on their behavior, not their properties, because class properties are what you need to hide, encapsulation is such a word. So you need to explain the behavior of this object, tell roughly how other objects will interact with it.
Lifer - sentenced to life imprisonment. Its only property is "life span". You can also Selfdestructor (lit. self-destruct).
duration, for example, if there was no such option already. And how do such tasks increase OOP skill?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question