Hi, if you make a program that stands on its own, meaning you just want to run it, not inside of something like BlueJ, then how does Java know where the program should start? In BlueJ you did not need to worry about such a thing. Because you just click the menus to tell BlueJ what objects to make and what methods to run. In any other setting a program starts in a method named main. When you run the program you specify which class the main method is inside of. The main method must have this particular type of signature. Public, static, void, main, string, array, args, ugh. You are already familiar with public which means that code outside of this class may call the method. Main has to be public. Since it must be called by the code, which starts up the program. The next word is static. It means that the message is not live inside each particular instance of the class but rather, there's just one of it for the class as a whole. You learn more about static shortly. For now, just know that main has to be static. Next you see void, which is the return type of main. It does not return any value. Next you see main which is the method name. The parameter to main is a string array. You are already familiar with those strings and arrays and this works just like any other method which takes an array of strings. This parameter represents the command line arguments to the program. When you run the program, you can specify what strings get passed into this array. Now let's take a look at an example of a program written in main. Does this program look familiar? It is the hello around the world program from the start of Java programming, solving problems with software. But it's been rewritten to use main, which you can see here. Notice how it has exactly the signature we described on the previous slide. The body of the main method then does whatever computation you want. In this case it reads the file hello underscore Unicode dot text. And prints out each line in the file. If you wanted to make use of the command line arguments to main, so that you could change what file the program reads without recompiling the code, you could do so. The code just uses args at zero to get the first string out of the array of arguments past n. Indexing into an array should be quite familiar by now. Of course, it is generally a good idea to check that the person who ran your program provided the right number of arguments. That way, if they did not, you can provide them a useful error message, rather than just having your program crash with an array index out of bounds exception. In this code we made us of Sysem.exit. Which just tells Java to quit the program entirely. Here we do this since the program cannot do anything without knowing what input you want to work with. System.exit is quite useful when appropriate. But use it only when you want the program to quit completely. It takes an int indicating the success or failure of the program. By convention pass and zero for success, and an non-zero value for failure, great. Now you know how to write a main method. So your program knows where to start if you run it outside a BlueJ. Thank you.