Can we make changes in main method in JAVA. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can we make changes in main method in JAVA.

class Solo { static public void main(String[] solo) { // Is this valid main method ? } }

6th Feb 2020, 6:52 PM
JAIN
JAIN - avatar
2 Answers
+ 6
Yes you can replace position of public and static with each other. The string array can have any valid name. It can be (String...a) also. You can even add final keyword to the main method and it would still work.
6th Feb 2020, 6:56 PM
Avinesh
Avinesh - avatar
0
Yes it's your own program so you write your own code there.
7th Feb 2020, 2:41 AM
Sonic
Sonic - avatar