Why main method syntax is given by sun people like
public static void main ( String [ ] args )
================================
👉Public :-it declare as public coz this method is called by whome jvm itself. So jvm can call it from any where. ..
================================
👉Public :-it declare as public coz this method is called by whome jvm itself. So jvm can call it from any where. ..
👉static:-coz main method no way related with any instance so without createing any instance jvm can call it .That's why it make it as static
👉Void:- void means no return type coz suppose ur method return some value to jvm then jvm what will do with this value. So it's return type is void
👉main:-this is simple name by naming convention nd only this name is configured in jvm that's why jvm always search that similar name i.e (main)...
👉(String[] args):- max used datatype in application is String so it is consider as command line argument. ..
Comments
Post a Comment