Hi friends, welcome to Tutor Sunny Channel. Today I am going to teach about a Access Certifier and
Constructor and Methods in Java Programming. It's a optional in the concept. So, you can see here
this is the class which I created as a motorbike. Okay. So, here I have defined
the three, two variables, string variables, access certifier as driver. If you declare the
access certifier as a driver, you can call it within the graph only. You can't call this
variable outside the graph itself. Okay. Right. So, if you want to work with the outside
you can call it. Right. So, after that what I did here, after that we have to create another
variable to meet engine power speed. Okay. So, this is the data type string, this is the unit
Okay. Now I am going to create as a constructor motorbike. Okay. How to identify that constructor
that name which is the same name of the class name is called as a constructor. The method name
which is the same name as a class name is called as a constructor. This constructor has three
variables. Okay. This three variables, two string variables, one int variable. Okay. This variable
model, how to set this as a, this driver can set it as a public, you can write like this
If speed equals zero, this model, this, you have, this, this are class level data. This is the
parameterized data. You have a class level data here equal to the parameterized data. Then only
it will work into the another class. Okay. So, here, so that you have to put a disk driver model
this model equal into the disk parameter. So, this color equal into the disk color
This engine power, it is going to be the disk engine. So, after that it will be fixed
So, after that you have to create three different variables. One is that accelerator
accelerator and changer. This is followed by one parameter. Okay. So, this is the
entry parameter. So, this method equals, we have set it as, if speed less than 200
we have type two plus equal one. This is nothing but 10 plus one. Likewise. It is a 10 plus
okay. It is nothing but, it is increased by one plus one. Okay. So, that's why it will be
completed, completed speed. Okay. After a break, it is, speed is less, greater than 10, it is
minus one. It will be like that. Like, like. Okay. So, after that what I am going to do is
public white change color, we have passed one argument as new color. This color equals
this color. We have to, this new color we have to put it here. New color, this color
Right. After that you show this here. You have to write first, print at this, second print at this, model. After that, this, this is all the stuff. What
is the, what is the model, this is all the stuff. This model, back model is engine power
this is all the stuff. So, in the details it will be, then you call the, this method
you call printout, printout. Okay. After that you have to do this one. Publish, print, get
model. We have written the model. We have written the model, this model we have to return. Okay
Right. So, in order to achieve this, we don't have main method in this class. We have to write
another class for main method. We have to call that model by true. We have to write inside the
main method of the class we have to write it. Okay. So, what are we doing here? Here this class
the same mean, we have to say, we have to say the object has to be new A class. We have to pass
three arguments. Panda, red. Okay. If we have passed this one, what happens, it goes to this
class. Coming here, it put it to a model, color and everything. It takes a class level data which
will be shown to the data set. So, then you call show data method. It will be show data object
Okay. That's the thing. Okay. Right. So, after that, what are we doing here is again
you have to write the for loop. Initial is condition, for loop function should be the
value. This is a condition. This is a increment. Okay. The aspirator, we have called inside the
for loop, we have called the method B to set the object in this class. Object we have set
it as B dot aspirator. What happens is, it goes here and takes, that's right, it is
greater than to this left hand one, which will be working like this. Okay. It will be calculated
When the speed is less than two, it's working. Check out this stuff we have tried
Okay. After that, we have tried three. This is called a show data. We have showed that this is
a show data. Okay. After that, what are we doing here is, we have to apply this one as a brace
B brace. If you have called it B brace means, it is coming here, what I will say brace
See. Again, we have to call the same here. After that, we have changed the color black
The second one we have printed. The third one we have called a show image. It is show image
Okay. We have to show images, we have called two times. First, we have called first time
we have called on the braces, this one. After that, we have changed the color as a black
so that it will work as a black here. Okay. The speed is first time increment
this one. Second time, it will be, again, it will be calculated this one. This one should be
90. Okay. These are the extra steps that we have worked in Java
Thank you for watching. If you have any doubts, you can let me know. Thank you for watching