What do you means by main function in Java- “public static void main(String args[])”?

No comments

Public:     The  keyword  public  is  an  access  spacifier  that  declares  the  main  methods  as  unprotected  and  therefore  making  it  accessible  to  all.

Static:    It  is  a  keyword  which  declared  this  method  as  one  that  belongs  to  the  entire  class  and  not  a  part  of  any  object  of  class.  The  main  must  always  be  declared  as  static.  Since  the  interpreter  uses  this  method  before  any  objects  are  created.

void:  The  type  modifier  void  state  the  main  methods  does  not  return  any  value.

String args []:   All  parameters   to  a  method  are  declare  inside  a  pair  of  parenthesis  here  string  args  declared  a   parameters  name  args,  which  contains  an  array  of  objects  of  the  class  type  string.

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀