‫Welcome back.
‫In the last video, you have learned how to write something onto the console.
‫And we have written our first Hello World Program.
‫And now let's go ahead and have a look at what this using means.
‫So we have used that in the last video and we simply had the code.
‫We didn't really have to write it ourselves.
‫And what you can see here is that those four lines are grayed out and that line here is not grayed out.
‫And that is because we use the system namespace in our code and you might wonder where is that?
‫Where do we use the namespace system?
‫And that is through the console.
‫So we have system console as a class which represents the standard input output in error streams for
‫console applications.
‫And that is exactly what we want to use.
‫So there is a class within the namespace system which is called console, and that class has multiple
‫methods and one of them is right line and another of them is read.
‫What methods are in detail is what we're going to cover later on.
‫But for now, as you can see, this static void main is a method itself.
‫So this one, the main is a method where we start our program.
‫So this is the starting point of our program and the console is a class which also has plenty of methods
‫and you can find them out by writing the name of the class, which is console and then dot and then
‫you find different methods.
‫So we have the method, for example, read, read, key, read line, and the methods are those little
‫boxes.
‫Then we have events.
‫In this case there is only the console key press event and then we have the properties which are those
‫tool icons here.
‫And properties is something that we're going to cover later on.
‫But what is important now is, for example, this right line and this right and read.
‫So if you want to find out more about what a method does, you can simply click on it and then you can
‫read the text here.
‫So it's explained pretty well.
‫And in our case we simply had this bright line that we have used here and we had the read.
‫But you can play around with those methods, you can check out what they do.
‫So we could, for example, reset the colors or we can simply change the color in general of our background
‫of the or of the foreground here, for example, for ground color.
‫And in here, we can set that by using the equal sign and then use the console color dot and let's go
‫with a blue.
‫So before that, our console color was always black, so the foreground color, but that alone will
‫not be enough.
‫And it's also important to have the right order.
‫So let's take that and put it at the top and now let's just try it.
‫So by the top, I mean at the top of our right line and as you can see here now, the text.
‫So the foreground is blue.
‫And if you want to change the color, you can easily do that by using a different color here.
‫So you have dark red, magenta, dark yellow.
‫So let's say I want to have the dark yellow as the foreground, color and console dot background color
‫being console color dot, let's say a gray.
‫So now we will have yellow text on gray.
‫And while that's not very beautiful and by the way, in order to make it a bit better, we need to clear
‫it as well.
‫So let's console dot clear
‫and now let's run it again.
‫And we are now we have this yellow text which we can barely read on the gray background.
‫So what is clear method does?
‫If you're wondering if you just simply click on it, you will find it out, clears the console buffer
‫and corresponds console window of display information.
‫So if we comment that out, so let's say we commented out just to see what happens if we don't have
‫that method in there, you can see that's what it does.
‫So only our text and well the corresponding area is colored, right.
‫So this console clear will take over the color for the whole console.
‫All right.
‫So that's what the console class can do.
‫It can do a lot more.
‫But those were examples of properties and these are examples of methods and all of that is within system
‫dot console.
‫By the way, if we get rid of all those console methods and properties, you can see that using system
‫is grayed out as well.
‫So now it's not used at all, but way with the minus and plus you can reduce the whole area.
‫So those whole five lines, you can reduce them to one line.
‫But if we now use the console.
‫It's coloured white again.
‫So let's get rid of those musings and you will see that the console suddenly returns errors.
‫So it says it doesn't know the console because it doesn't exist in the current context.
‫So in order to add it, we simply click on it.
‫So let's click on the error and then show potential fixes.
‫Or you can also get that with old enter and then it will provide you with different solutions.
‫So for example, you could use system console.
‫So by that system, that console, that will work.
‫But it's much easier to not only you add the system to one of them because we would have to add them
‫to every single time that we want to use the console.
‫It's much easier to simply import the namespace by adding using system.
‫All right.
‫So as you can see here, now, we have at the top using system and our console is green again, which
‫means it exists.
‫So this class exists and it's known in the current context.
‫So this year system is a namespace and it has a class called console.
‫We understand that already.
‫But now as you can see, there is a namespace called Helloworld.
‫So whenever we create our own code, we can use that as a namespace as well in order to access its methods
‫and properties.
‫But that's something that's going to be relevant much later in the course.
‫So let's just keep it at that.
‫And now you see what this using is for.
‫You can understand a bit better what system is about, what the namespace is about, and how to play
‫around with your console colors.
‫By the way, I wouldn't recommend to use those colours because they don't look great and you can simply
‫play around with different colours that you prefer.
‫And I'm just going to comment out those two lines and at the same time I'm going to comment about console
‫dot clear.
‫By the way, you can play around with the order just to see what happens if you do that later on in
‫the code.
‫And in this order that we have here, everything works fine.
‫Great.
‫So see you in the next video where we are going to have a look at beta types and variables.