I have searched for answering StackHowforflow and Google, but I do not need it.
What am I seeing:
Is there a way to set default values for the class properties of the class? As we can do in Java, for example in class creator--
MyClass (int a, string str) {// constructor this. A = A; This.str = str; // This is the same type of obj-C because this .x = a * 5; This.y = 'nothing'; } Why am i looking for:
I have a class with 15 properties when I instantiate the class I have to set all those variables / properties with some default values. So it makes my code very complex if I can set some default values in those example variables of that category, then the complexity of this code / redundancy has to be reduced.
I need your help
-Sadat
p << em> write init, which is doing all the work of full initialization
Then just write several beginners with many parameters set (as you need it (but think about this: do you actually it or that < / Em> Need one?) No, do not let them do the job. Do not give them all the default values (for which you send messages to messages , this Do not provide) and give it to the first one.
This is the first one initator named the initator and remember that never do not ignore one named
Greetings
Comments
Post a Comment