Java programming error in main method

Asked By 0 points N/A Posted on -
qa-featured

This is the java code. The error occur in main method

SHARE
Best Answer by kamrul Islam
Best Answer
Best Answer
Answered By 10 points N/A #111462

Java programming error in main method

qa-featured

There are many reasons for appearing error at java program in main method.

1. Most of the errors are happening at the time of declaration main method. 

At the time of declaring main method, you must use exactly this type of format:

                                          public static void main(String args[])

                                                          {

                                                                   };

Always remember that 1st word of argument in main method “S” must be a capital letter otherwise program won’t run. And you must add argument in that main method just like “(String args[])” . And also don’t forget to use free space “ ” between every single words. Other special characters aren’t allowed.  You must have to finish main method with semicolon “;”.

  • Method calling system must be perfect.
  • Methods must be called by its dedicated object.
  • Object must be created for every method.
  • Java file must be saved same name as its class name.

If you did not do any of this, error will shows at java program in main method.

Related Questions