In this Java lesson we go over the main method. Whenever we run a Java program, the code within the main method will run. In our Dog.java program we have a Dog class. Within our dog class we have our main method. Whatever code we put inside of our main method will be executed when we run our program.