So first of all let me comment with this line of code here because I don't want to execute it.
So I want to actually access the value of this valuable that I created in this law and class.
OK.
So inside the main class you want to actually output the value of the speech value that I created inside
the lion class onto the console.
So how can I do that.
First of all I just need to take Here system that's out print to learn and then inside the apprentice's
I just need to refer to the name of my object.
First of all OK and then I use the dot notation here.
And as you can see it's going to actually show us the speed valuable that I created inside the lion
class.
OK.
It is now recommending us to choose this option.
So the name of our barrier is speed that data type are valuable is it.
And this variable is inside the client class.
OK so if I use speed and then at the end of my statement I put a semicolon.
So now if I get on my project as you can see it's going out with this value to the console.
OK.
So this value is the value of this valuable that I created inside the client class.
Ok this variable is dedicated for the instances that we create from this law class.
OK.
Here we are actually creating an instance from this client class and in line 14 we are actually outputting
the value of this value in the value of this variable that we created inside the lion class.
So now let me show you that you can actually change the value of that speed variable.
So first of all I need to refer to the name of my object my line and then dot and then I choose this
variable.
And then I can assign another value to my valuable for example number 80.
And then at the end of my statement I need to put in a semi-colon.
So now if I want to output the value of my Spizz valuable to the console I just need to type in her
system that out that print land and then inside the prentices I can my life in that speech.
OK.
And then at the end of my statement I need to put in a semicolon.
So first of all let me actually put a text here or there to specify that the value of my line object
is actually changed.
So I just need to put into double quotes here and then I use the plus operator here in order to actually
concatenate this object to my text.
OK.
So inside the double quotes just type in here this is the value of the speed variable of my line object.
OK.
And if I run my project as you can see it's going to output this value to the counselor OK.
This is the value of this valuable of my line an object number 80.
OK so let me actually create another object here.
OK.
So again in order to create another object from this law class I just need to type in here relion.
OK.
The name of my object is my second line.
OK.
And then I use an assignment operator here.
And then I use then you convert and then I'll refer to the name of my class.
And then after the class name I put a pair of round brackets and then I put semicolon at the end of
my statement.
OK.
So as you can see here are second the lion is now created.
So now in order to make sure that our line is created and it is stored in silver inside the memory I
just need to type in here system that out that print land and then inside the practices I can just refer
to the name of my second line object.
OK.
And then at the end of my statement I need to put in a semicolon.
So now if I run my project as you can see this is the address of our second line object inside the memory.
OK so let me actually comment out this line of code here.
And now I want to actually output the value of this valuable for this instance of the line class to
the K..
So I just need to type in here system that out that print line inside Apprentice's.
I just need to refer to the name of my second line object.
So here I just need to type in here my.
And then I use the autocomplete feature of the eclipse and then I choose the my second line object here.
And then I posted the dotted notation here and here I can actually access this area of this like an
object.
OK.
So if I choose this variable i need to put a semicolon at the end of my statement.
So now if I had on my project as you can see the value of this value is now 100.
OK.
So as you can see here in line 15 I actually changed the value of this space variable for my client
object.
OK.
But this sweet valley Bell is actually a copy of this speech.
Valuable here.
OK we are not actually changing the actual value.
We are actually changing the value of a copy of this value.
OK.
This variable is dedicated specifically for every instance that we create from this class.
OK.
So if I for example changed the value of these spent valuable in line 15 it doesn't mean that we actually
changed the value of these Spaeth valuable that we created inside the client class.
We only changed the value of this variable.
That is only for my client object here.
OK but here in line 19 I decided to create another object from this line class.
OK.
And inside the main class I actually tried to output the value of this variable for this.
My second line object to the console.
OK.
So as you can see here this value is 100.
OK so this variable is actually a copy of this value.
OK.
When you actually access this variable from another class we are actually creating a copy of that variable
here.
So here if I for example want to change the speed of my second line object to another value I can just
type in here.
My second line.
OK.
That speed.
And then I can assign another value to my variable for example number 30.
And then at the end of my statement I need to put in a semicolon.
So now if I want to output this value to the console I just need to type in her system that out that
print Len
and then inside the prentices I can just type in here my second line in that speech.
OK.
And then at the end of my statement I need to put in a semicolon.
So now if I run my project as you can see the value of this bit valuable of this my second line object
is now 50.
OK.
But the value of this sweet valuable of my life object is 80.
OK.
So when we actually access this valuable that we created inside this class from another class we are
actually making another copy of that variable in our class.
So because of that this variable is called instance variable.
Ok this variable is dedicated for every instance that we create inside our main class.
OK.
So inside the main class in Lankton I decided to create an object from the slide in class and I named
this object my lion.
OK.
And in line 14 I decided to output the value of this valuable through the console system that out that
princeling my life and that speed.
So here you are actually referring to the value of the copy of this variable.
So for every instance that we create from this in class there is going to be another copy of these Spaeth
variable for that specific object.
OK.
So if I for example want to create another object.
First of all I just need to refer to the name of my class line the name of my object is.
For example first line and then I put an assignment operator.
And then I use the new key word here and then I refer to the name of my class and then I put a pair
of round brackets here.
And then at the end of my statement I need to put in a semi-colon OK.
So now I just need to type in her system that out that print learn and then inside Apprentice's I just
need to type in here ferde line that speed and then at the end of my statement I need to put in a semicolon.
OK.
So now if I run my project again this value is going to be 100.
OK.
Why.
Because we are actually referring to the value of the copy of this variable.
OK.
So if you want to actually change the value of this Spizz valuable for this further like an object I
just need to type in here first the line that speed is for example 20.
OK.
And then at the end of my statement I need to put in a semicolon.