Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
You don't need to do this. This is contrary to the OOP ideology.
An object is not something with fields, methods, interfaces and other nonsense.
The primary meaning of an Object is that it is a data structure. And then already goes "with methods of operation with these data".
Thus, globally - an object is a place where data is stored, and variables must be encapsulated, not in the way you want.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question