 Hi everyone, in this video we're going to talk about how do you create any Java project in Visual Studio Code. So there are three requirements. The first requirement is that you should have installed Java standard edition. The second requirement you should have installed Java, sorry, Visual Studio Code. And the third requirement is inside Visual Studio Code. If you take a look at the bottom left corner, you can see an extensions option. And there's an extension for Java, Java extension pack. You should have installed Java extension pack. So once you have these three, then you're good to go. Now, once you have these three, then you click on the top right folder kind of option which is for Explorer. And it's not rocket science, we're going to open a new folder, we're going to clone it positively, we're going to create a Java project. We don't want any build tools. The location, we're going to create a new folder. And the name of the Java project is Hello World. For naming convention, please see my other video where I have created a first Java project in Xlips. A new Java project is created for us, which already contains the source folder, which already contains a source file, which we do not need. So you're going to delete that completely. Inside the source folder, we're going to create a new file and call it myfirstjavaproject.java. The good thing about Visual Studio Code is that when you create a file, myfirstjavaproject.java, it automatically contains the public class with the same name, which should be the case. Because if the name differs even slightly, then you get a compilation error. We're going to click, we're going to type in main. And the good thing about, another good thing about Visual Studio Code is that it auto generates your public static world main function. And then we're going to create a little piece of code that does something slightly different than what we did in Eclipse. So let's say we have an integer. And we would like to find out the first digit of that integer. So if my integer taxicab is 1729, then the first digit is one. Because you don't know that there are going to be four digits only because they could be 172938 or 172947, etc. Which means that I am going to write a function. So this should go outside main because it's a separate function. Again, public static. The name of the function is int and first digit. When it's passed a value of type int, which we can call whatever we want, we'll call it int. It returns. Well, how did that happen? Please see my other video about Eclipse. It's the same thing. It's a Java doc. It returns the first digit of int. Again, zero is the first and the only digit of zero. So that's the case, which means that the first thing we're going to do is we're going to say if n is less than zero, which means it's negative n becomes minus. So we make it positive. Why do we do that? Because if the number is negative minus 1729, then its first digit will be returned as minus one, which we don't want. So we can either pre-process n to be positive or we can post-process the result to be positive. We can talk about that later. Okay, once we have n as a positive number, now please note that n is a formal parameter. So we can modify n inside the function and whatever value you pass to the function won't actually be modified because n is a copy of that variable for integers. Yeah. So I can simply say while n is more, while n is more than or equal to 10, which means it has more than one digit. Keep dividing n by 10. So n becomes n by 10. The shorthand for this is n slash equals 10. That's it. We keep dividing n by 10, which means what's guaranteed here is that n more than equal to 10 is false, which implies n is less than 10, which implies n is a single digit number. So n is the single digit number, and it's the first digit because every time you divide the number by 10, 1729 divided by 10 is 172, then 172 divided by 10 is 17, and then 17 divided by 10 is 1. So you keep dividing number by 10, and it will reach one or sorry it will reach a single digit number. One more time if it becomes a, which means if we have reached the first digit, we can return the number. All right, let's try this out. Let's try the first digit of taxi cab number is first called the function first digit with the parameter taxi cab. So now please note that taxi cab is your actual parameter. And the actual parameter is copied into the formal parameter. This is the copy of taxi cab. In the scope of that function code. When I run my program, you can see that the first digit of taxi cab is one. If we had a negative number. Then also you'll see that first digit of taxi cab is one. If I didn't include this. First of all, n is not more than equal to 10 because n is negative. It's one minus 1729 directly. So when I run this. It gives you the wrong answer, which is minus 1729 so now you can see why I had to do that. Of course, you can do post processing on n as well but that doesn't really matter right now. That's how you create a new Java project in visual studio code. Thank you very much and hope to see you soon.