Note that there are some explanatory texts on larger screens.

plurals
  1. POJava Understanding Java main method on logic
    primarykey
    data
    text
    <p>The main method is the most significant method in your Java application with regards to launching your application as the entry point. What happens prior to this method being used is unclear. Please can someone help me understand/clarify what happens before the method is used by correcting my perception thereof based on the method signature as follows:</p> <ul> <li><p>The JVM creates at least one Object that will access your main method. This (assumed) object attempts to access your Java application according to the API which obviously binds you to the known method signature <code>public static void main (String[] args){}</code></p> <ul> <li><p><code>public</code> You can't restrict the (assumed) solitary object on the JVM from accessing your Object housing the main method completely looking at logic alone and not the API/signature?</p></li> <li><p><code>static</code> There are simply no objects up and running to create any other instances of objects up yet (other than the assumed JVM one) to instantiate or create objects out of yet. The static modifier implies the only possibility of accessing this method as it is not bound to an instance and can be accessed therefore 2ithout an instance. Yet again this is logic as without any objects up and running (apart from the assumed JVM one), there can't be any objects up yet to instantiate any other objects with?</p></li> <li><p><code>args</code> A standard across languages and applications/executables to provide ability to customize the application?|</p></li> </ul></li> </ul> <p>Is this a correct and logical way to approach and understand the main method?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload