Java programming error in main method
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.