How to execute the main(String[]) method

Before diving into the garbage collection process, we would like to review and summarize how to run an application from a command line. In Java, the following statements are used as synonyms:

The reason for that is that each of the listed actions happens every time you execute one of them. There are also several ways to do it. We have already shown you how to run the main(String[]) method using IntelliJ IDEA and the java command line. Now, we will just repeat some of what has been said already and add other variations that might be helpful for you.