Devey you initialize an object from a class has a lot of implications.
That is how you do it what kind of promises you have to enter in your initialising good as well as you
know the impact it has on the life cycle of an object.
So this is an under the creeky talked about the initialization methods and why you have to use them
and how you have to use them.
Let's go to ex-cult and the next score.
I'm going to go ahead and start a new command line tool.
I'm going to call it initialize.
I didn't initialize.
I'm going to go ahead and start a new class.
So let's call this one again.
A User class.
And let's see what we have for it in here.
I'm actually going to go and add five different attributes to my class.
So the substitutes are going to be great name you Id not like that you like the photo and email and
to declare all of them I'm going to use de-friended ways of doing them because each of them has to be
initialized in a different way.
So this isn't exactly a scientific way of doing some of these might be said in different ways.
But for now I think the way you're going to do with this kind of making sense.
So for rape I'm going to say it's a variable is mutable.
It is of the type float.
I'm going to say it has to be 0 at the beginning.
So when you are initializing a user it's current rate should be zero.
Then I'm going to go ahead and say there is a name and the name is a string.
And that's about that.
It is not optional.
It has to be initialized at some point.
Then I'm going to go ahead and say that is a viable ID which is a string.
It is an optional but an option that I know really soon it is going to be set.
So we have to really set it really really almost immediately after the initialization.
Then I have another one called variable for thought which is a name of a string and that is optional.
I don't know if my user has a photo or not.
And then finally I have something that is a list.
It is a static value.
It's a constant.
Is not going to change what we have to set it at initialization.
So then the right is really quickly.
So rate is set at default and then name is not optional.
And then I have the new ID which will be set real soon almost immediately photo which is completely
optional and I have an email which is Konstanz what can be set up in it.
So what does it mean.
It means that we have these five attributes.
And let me see how many of them are name which is not an option.
And email which is not an option I should have mentioned that not optional.
These two have to set.
No matter what the others.
We can just leave them for now and then decide about them later.
Now excuses is giving me an error or saying that your class has no initializers So let's go ahead then
add an NGO.
I'm going to say in it and in the unit I know two things that they must be there.
So one of them is this that Mary you know or there are things so kind of makes more sense like that.
So you might I say input's name which is going to be a string an input e-mail which is again going to
be a string and whatever that it does I'm going to say self that e-mail is input E-Man and self-caused
name is going to be input name.
So now I have one in it that initializes the tool guys that are not optional.
Everybody else you know we could deal with them later on.
Now if I go ahead and say that my user is going to be user is going to say well we do like to initialize
it be dismantled.
And this is now the only method that we can use to initialize our users simply because they have overridden
that any it we can't use this anymore.
Now sometimes not just sometimes a lot of times you have situations that you have more than one kind
of in it.
Imagine this my array is N.S. are a dot in it.
And then in the net as you can see we have multiple different types of in it's in it's with an array
in it with an industry in it for the Khoder object things that you know some of them we know what they
are some of them we don't know what we are.
So we have to actually choose which one of these you know anything you want to use and what I want it
to have that for my user stuff going here and say well there is another in it.
And in the other end it the two things that there must be there they are there.
Nobody is going to have a question about them.
But I also haven't put forth all which this time it is there.
And these two things happen as they should.
And then self-taught photo gets to be input for as.
So now if I try to make a user if I go in here and say like my user is going to be user then I have
to what we call flavors of dysfunction two different ways of triggering in it.
One of them would need to like humans.
One of them would need three arguments.
Let's choose this one input name an input email or both are empty.
And that's pretty much about it.
So we have two or three or 10 or hundreds of different types of minutes and then we have attributes
we have to know whether they're optional or not optional.
If they're not optional they have to be somewhere within our in it or they have to have a default value
such as this one.
And then we have to write the body off or in its methods and then depending on our use we can use this
one or the other one or any other one.
There is one kind of initialization that's got a convenience in it.
I should have mentioned that these guys are card designated in it's so that the designator then it also
has this one.
And then the next listener we're going to talk about a convenience and it and it that helps us you know
be special cases and so on.
So I assume that then.