DEV Community

Cover image for 1.Main Method in java
Souravsing Pardeshi
Souravsing Pardeshi

Posted on

1.Main Method in java

public class main{
    public static void main(String[] args)
    {
        //code
    }
}
Enter fullscreen mode Exit fullscreen mode
  • entry level is main method.

  • this method is public so it can be easily found by jvm.

  • void because not expected to return anything.

  • static so no need to create object of class for execution.

  • String[] args are array of string as arguments for code.

Top comments (2)

Collapse
 
angela_learns profile image
Angela Gupta

Good work!

Collapse
 
souravsingpardeshi profile image
Souravsing Pardeshi

thanks 😊