Top Digital Marketing Services India updated in 2019

Top Digital Marketing Services India updated in 2019


Introduction:

See another example of a type of person here and it might be a little bit more realistic in terms of where you would use object-oriented programming. So let's say we have class customers, of course, will extend the Person class is going to be a subclass of person. And when we invoke the constructor Let's pass to digital marketing services India it an object and we're going to use some E- defaults here. So let's say the name doesn't matter name will just be generic customer age same we can just say. And a for example for age customers don't really care about their age. Finally, what do we want to know? Maybe their contact method that's going to be fine for the constructor, therefore, we can say the name of best digital marketing agency in the super method name and age because of course person does require those in the constructor name age and this contact method. Equals contact method.

Simply Digital:- Considering this is an object maybe we can also initialize it with something we don't pass in and it's not required to pass something in if you want to initialize a value. That means, for example, we could say this dot account credit so all customers will start with no for account credit. And then this can go up or down using different methods on the class. So let's say we can say add credit and this can take in an argument which could be amount Mount for example.

Reinvent Digital Media:- So this is a class method and we can say this account credit plus equal the amount that was passed into the method. We could also do the reverse of that. To reduce credit for any given amount. So, therefore, we can say this account accounts credits minus equals amounts. And that's all we need to do for now. Right. And my Linter is complaining about these but not going to worry about those. This should work. Fingers crossed. Right. So recall with our defaults this is another E feature where if it receives undefined for either of these values it's just going to sign this as a default. Note that I have placed it into an object literal here. So it's going to be looking for the object and I don't have to do the contact method is the contact method because I can kind of restructure that using ESX as well.

That's a lot of nice quality of life improvements here with the basics. So let's say let's see we have a car can and we're going to call it customer equals new customer and it's going to look for an object in the constructor. So if we do contact method is e-mail, for example, let's see if we can instantiate this customer so we'll do a console log. Customer and we should see an object with a name of customer and age of and a and a contact method of e-mail. Let's see OK. Still, unbar. Try that again. There you go. Looks like we're successful radar account credit did initialize with no value. Age was an A which was the default. We said it at the contact method e-mail name customer. And of course, if we did want to pass in a name we could have done so like so. Right.

Copperjam:- This is just an object. If I try that again. So now our customer has a name but you know what. We don't really need one because I wouldn't if we want to but we could just do no customer or undefined or whatever. But then do we have our customer down and our customer comes along and says oh I want to return this item. Can I get a credit for that on my account? And we say yes, of course, you definitely can. Therefore we're going to do customer thought add credit and the amount is you say dollars just represented by the number. So at this point, if we check customer account credit what is your account credit. I need to cancel all that. What's your account credit run. No. Makes sense. What about now. Cancel log. Kostner one account credit.

Now you have a credit of. OK. So makes sense. Our method is working. What if afterward, we do customer one door reduce the credit by customer bought something worth fifty dollars. And we check the credit again. No goes to. And then down to and this is a completely separate object from if we were to create customer to customer or two equals new customer this one can be decided to give us his name or her name like Jane Doe. Declined to give us the age but contact method mobile phone.

Conclusion: So at this point, we can check customers too. What's the status of your account credit customer to account credit. Let's see OK. No. Right. This is a customer . And finally customers and these are completely separate objects right. They don't interact with each other. You know one thing they have in common is they both extend from the class person and you know that's one of the principles behind object-oriented programming is you have these distinct separate objects.

They may interact with each other. You know maybe you're making some kind of game and you have a class player and then another. Now you instantiate one player and then you essentially to another player and then they can make moves or do something like that. But at the very very basics, you know this is the kind of thing that object-oriented code is kind of designed for.