Timeline for "public static" or "static public"?
Current License: CC BY-SA 2.5
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 27, 2023 at 6:41 | comment | added | Richard Smith |
C++ does require the access modifier first because it has a slightly different syntax: public: static . Java and C# are both modelled on C++, even though they changed the syntax a little in this case to the remove the colon. I think that's why it's the norm to write public static in these languages.
|
|
Jun 15, 2013 at 11:18 | comment | added | Nicholas DiPiazza | i think whatever you use, just stay consistent. then no one will care what order you use. | |
Apr 16, 2009 at 18:44 | history | edited | Andrew Hare | CC BY-SA 2.5 |
added 103 characters in body
|
Apr 16, 2009 at 18:43 | comment | added | Jon Skeet | (Undone my downvote though, as the rest is fair enough - and I certainly agree that "public static" looks more reasonable.) | |
Apr 16, 2009 at 18:41 | comment | added | Jon Skeet | Neither Java nor C# require this. I believe they recommend it, but "static public" is valid in both languages. (I've just compiled a test program to check.) | |
Apr 16, 2009 at 18:25 | history | answered | Andrew Hare | CC BY-SA 2.5 |