For example Mefford one.
OK.
And then I need to put in a semi-colon at the end of my statement.
OK so now I want to actually call the Smurfette from the main effect of this main class.
OK.
So now let me actually comment out these lines of code here because I don't want to execute these lines
of code.
OK.
And then I want to actually call the Smurfette from the main method.
So I just need to refer to the name of mine if it Mefford one.
OK.
And then I need to put in a pair of round brackets after my method name.
So as you can see here it's now showing us an error.
So let's actually hover over the error area and see what's the error cannot make a static reference
to the non-static method one from that type main.
So as you can see here we cannot actually fare through this method.
Why.
Because this it is not static.
Because we are calling this method from the main method of this class.
OK.
So the pointer to this method is our main class.
So in other words if we actually put the static keyword here now the error is gone.
OK now we can actually call this Smurfette from the main method.
OK.
So as you can see here in order to column A fit inside our main method inside our main class we need
to make that specific method a static method or or in other words a class method so that we can actually
referred to that method inside.
Our main method.
Ok this main method is a static method.
OK.
This means that this method is a class method.
So we must actually make this method a class my Fed in order to call this method from this main method.
OK.
So this is very important.
And another important point that I want to touch about is about this system that out that princeling.
OK.
I actually told you that this is the job was very easy in order to output some values to the console.
But now that you know more about classes objects and methods now you can understand what does this statement
mean.
So this system here is a class.
OK.
So now if we actually hover my mouse pointer over this vote here as you can see it says the system class
contains several useful class fields and methods.
OK.
And it cannot be instantiated.
So now we know this system is a class.
OK.
And as you know already a dot operator here as you can see the dot operator can only be used to call
the methods and variables.
So we know that out must be either a method or a variable.
So this out is either a method or a variable.
OK.
Because we used this dot operator here we just referred to the name of our class system dot.
So this out must be our method or our variable.
Ok so how do we actually identify whether this out of is a variable or if it does so out is not a method
because of the fact that there are no Prentice's after our word here after this.
Out here as you can see.
Remember that whenever you call him F-ed you need to put a parenthesis after your name.
So there is no parenthesis after our vote here after this.
Out so this out here is not MF it so it must be of valuable.
OK so we know that out is valuable.
So we must now ask ourselves what kind of variable is it.
There are two possibilities.
It could be it could be a static or an instance variable because out is being called a system class
name itself and not an instance of a class an object for example.
Then we know that out must be a static variable.
Ok so since only static variables can be called with just the class name itself.
So this out here is our static variable.
Ok so now we know that out is a static variable belonging to the system class.
OK.
Now as you can see here we've got this prince Len method here because there are Prentice's after this
printed in here.
This print plant is a method.
Ok this out is a static variable belonging to the class system.
But now we can see that out must be an instance of a class.
Why.
Because it is invoking the Meffert princeling.
OK.
So this out here must be and is an instance of a class.
So now as you can see if I hover my mouse pointer over and this up and vote here out it says print stream
Java that land that system that out.
OK.
So it this out here is up is an instance of the print stream class.
OK.
That is inside the job without the large package.
So as you can see here it says the standard output stream this stream is already open and ready to accept
output data.
OK.
Typically this stream corresponds to display out food or another output destination specified by the
host environment or user.
OK for a simple standalone job applications a typical way to write a line of output data is system that's
out of insulin and then inside the prentices we put our data.
OK so this out here is an instance of the print stream class.
Why.
Because we called the Smurfette on this out here.
OK.
We can only call if it's on our objects or our classes sort this out.
Here is is an instance of the Princeton class and inside the Princeton class we have an instance method
that we call on this out here.
OK.
And that's how we can actually output some data to the console.
So I think that's enough for this tutorial.
If you have any questions please post the discussion in the course.
And thanks very much for watching and I'll see you in the next tutorial.