why are we define a function in a class; does it necessary? does we have a class with out a function?what do we call it if we have?
how many function can i define in a class at most and at list? does there is any rates between the numbers of method and properties and function in a class?
Note, a function in a class is commonly called method. I will assume you meant regular functions/methods here, rather than the constructor and destructor, which are also functions, with a distinct purpose. ● Why define a method? to add ability for the class to "do" something. ● Is it necessary? it depends, if you need your class to be able to process something then yes, some classes are designed only as data storage, for other class to process, in this case, method is not necessary. ● Class without a function, what to call it? I'm not sure if there is a special name for such classes. Others can tell you better I'm sure. ● How many methods can we define? I can't tell you that, but I can tell you it is better to design your class slim, focus on what they are meant for, nothing irrelevant should be in the class. ● I'm not sure I understand what you mean by rates here, so I have nothing to say. Sorry I couldn't answer all your questions, but no worries, there are others here who can add more; Hth, cmiiw
Why are my users being logged as [object Object] when logging my array/user instead of giving me the values [name, age]?
JS in sololear is latest version or older? What do we use often VAR or LET and CONST?? I Have VAR is no longer used is it true??
Как сравнивать строки в Phyton?
Kotlin get if Var doesn't exist