 Hey everybody, this is Brian and if you've been paying attention, this is video 3 in our Java series. Today we're going to talk about the Java project. We have Eclipse open. If you don't, go ahead and open it. Remember the last video we covered how to hide and restore the different elements. You're just going to go File, New, Java Project. Now you notice there's a whole bunch of other stuff in here. Eclipse is not just for Java. You can have just about any language in here. Eclipse is a plug-in framework. So you may be talking to your friends and like, oh yeah, I code Python in Eclipse or I code C++ in Eclipse but for these tutorials we're just going to cover Java. So just go Java Project and let me bring the window down here. You're going to want to give it a project name and this is the workspace. You probably prompted for this when you started Eclipse. For this we're just going to call it Test. Notice how it automatically appends the project name to the end of your workspace. Your workspace is just your files, where they're going to be stored, how it compiles it, etc. Use an execution environment. We're going to use Java 1.6. As you can see I've got quite a few installed. You can use a specific runtime environment. You can use a default. There's a lot of options in here. A lot of these really won't make any sense to you. Usually I just hit Finish but you can hit Next and actually explore the interface a little bit and see how it's going to lay it out. There's some additional options in here you might want to look into and explore but like I said we're really just going to whip through this and we're going to just hit Finish but I wanted you to see some of these items like libraries. You can include additional libraries, order an export, just hit Finish, trust me. Now you notice in your package explorer you have this new thing called Test but there's nothing in it. We just made a project but now we have to add something to our project so we're going to enter a class and you see how it says package default source folder test source. Test is our project name SRC is short for source. This is a sub directory it automatically provides for you. Package name. Now you see this little icon content assist available control space so you can just press control space. It's not working on mine but it'll sometimes help you. A package. What is a package? A package is a naming convention. Let's say you want to create something called a cat and your friend wants to create something called cat. If you have those in the same project you're going to have what's called a naming conflict. You can't have two classes of the same name so you have to put them in different packages. For this we're going to leave it as default we'll cover packages later. I just wanted to let you know it exists. So what's a class? A class is a blueprint that's what we're going to be making is a blueprint. We're going to call this start and you see down here which method stubs would you like to create. We're going to just tick this little item that says public static void made string arcs. Cover this in just a minute so just kind of follow along with what I'm doing. Leave constructors and super classes blank inherited abstract blank. Just go ahead and hit finish and you see it generates some code for us and now over in our package explorer we have a default package and start.java. Let me actually restore that so you can see. So here's our project. Here's the source subfolder. Here's our package which is default and there is start.java. Now these are the libraries we're using. These are all added behind the scenes. You don't have to add these. They're provided automatically. Java is considered a RAD language by RAD. I don't mean it's cool, although some people think it is. I mean it's RAD R-A-D or rapid application development. You can make an application much faster than you could in a traditional language like C++. So let's just dive right in here and explain some of this. Public class start. You can see these brackets. This is a bracket language. It's a lot like C++. These brackets denote the start and stop of a code block. So this is a class. This is a method. These are comments. We're going to break this down very quickly. A class is a blueprint, kind of like building a house. We're going to create objects. Everything in Java is an object. I'm going to repeat that one more time. Everything in Java is an object. It is an object-oriented language, and I mean everything is an object in Java. So before you can run a single line of code, you need an object or a class. The class is a blueprint for that object. So what is an object? Well, an object is a class. They're the same thing. They're interchangeable. Now, you could argue that an object is an instance of that class. For example, let's say you have a blueprint, you're building houses. You build one house and paint it pink. You build another house and paint it blue. Those are two objects or instances of that class. The class is the blueprint. The objects are the instances. I hope that's not too confusing. I know first time people walking into it go, well, what are you talking about? For the sake of argument, just know that you need a class or a blueprint. The name is pretty much anything you want to give it. There are certain keywords you cannot use. I'll cover those later. Public just means that anybody can use it. Public static void main. This is the method. This is public. You see it up here. This is called an access modifier. Determines who can see this. Well, the public or anybody can see this. Static. This means that it is owned by the class, not the instance. We'll get into that later. Just kind of drink the Kool-Aid for the minute. Kool-Aid means it's going to return nothing because methods can return things. These are called arguments. String bracket args. What does the brackets mean? It means returning an array. Something we'll get into later. I know I'm saying we're going to do a lot of this stuff later. I don't want you focusing on too much of this. I just want you getting familiar with the interface. Go ahead and hit enter and just type system. You notice how when you hit dot, a whole big list of stuff pops up. This is called IntelliSense. It figures out what you want as you type. Do system.out.println short for print line. At any time you just hit enter and it'll add the code for you. It's traditional to say hello world, if I could type, whenever you're starting a new language. We're going to do the obligatory hello world program. You see some little icons here like to do. Eclipse is a dynamic IDE meaning you can actually take sections of code and collapse them. They still exist. You just collapsed it. You can add to do's or little notes. You can see I've got an auto-generated stub method here. You can say wash my car. You wanted to put here to do wash my car. To run this, you're going to just click the run button. The first time you do this, it's going to say how do you want to run this? I don't understand. Select the resources to save because we haven't saved it. You can tick always save resources. We're just going to select that head okay. You see down here in the console window, it's going to say terminated. It sounds really scary. It just means that it stopped. Start which is confusing. Java application. C program files, Java, JRE6, bin, java.w.exe, and then the date and time. This is the actual program that's executing your Java file, these start.java. You see there's our hello world. So what happened here? Running out of time here. So I've got to quickly go through here. What happened is you started the Java runtime environment and that is this Java W or Java window.exe and it created an instance of this class and called main. And inside main, we have our system out print line which prints to the console of hello world. So is any of that confusing? You bet it is. Why? Because it's a new language. So check around and watch our next tutorial. We're going to be going over classes in depth about what they are and why we need them. Thank you for watching. I hope you found this video educational and entertaining.