Java Program Template Java Programming Tutorial. You can use the following template to write your Java programs. Choose a meaningful "Classname" that reflects the purpose of your program, and write your programming statements inside the body of the main() method. Don't worry about the other terms and keywords now. I will explain them in due course.