- 1
[Solved]Can we replace the "main" method in Java to some other name like "hello"?
Hi! Here's a perfect answer to this: https://stackoverflow.com/questions/10947464/in-java-can-public-static-void-main-be-renamed-or-refactored
5 Réponses
+ 2
Im'ma Coder R
"Can we replace main method with other name"
You said perfect answer is here so I assumed you were saying "yes we can replace means we can run without main method" but see your shared link main method is still there. It means we can not run java program without main method.
We are just creating duplicate method and calling in main method.
+ 1
A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ Hi, I didn't really get you "You are calling...." thats exactly what was told in the answer. Moreover there were many answers there so it depends which one you read.
And I didn't get which guideline I dishonoured. Could you explain?
+ 1
Im'ma Coder R
You are asking question as well as giving self answer with question which is not as per SoloLearn guidelines.
0
Im'ma Coder R
That's not a perfect answer.
You are calling boot method inside main method so in simple without main method you cannot.
And please follow this guidelines:
https://www.sololearn.com/discuss/1316935/?ref=app
0
A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ Ok, so you had misinterpreted my question. Anyways, yes I agree that this might look against the guidelines, actually after posting the question I also found an answer so thought would paste it here.