Computer Science, asked by anuj, 1 year ago

What if I write static public void instead of public static void?

Answers

Answered by marsmeloo
3
heya u can write the both words because they both are coorect
hope you have understand this have a good day bye

lokeshgmali: but according to me u havent undesrtands his question
lokeshgmali: its about JAVASCRIPT
Answered by lokeshgmali
2
And now comes the why part. Why are we able to do it?Now, back to the task at hand. Both the following codes behave identically:(....._____) in picBecause we can. The Java specification agrees, and this closer look at the "Hello World!" application agrees as well.The method names comes last, the return type the second to last, and then after that it's your choice. It won't affect the code to any degree, but it's generally considered a convention to place the access modifier at the forefront of the method definition. Have a look here to get more insights on the matter.
Attachments:
Similar questions