Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 2
    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.)
    – Jon Skeet
    Commented Apr 16, 2009 at 18:41
  • 2
    (Undone my downvote though, as the rest is fair enough - and I certainly agree that "public static" looks more reasonable.)
    – Jon Skeet
    Commented Apr 16, 2009 at 18:43
  • i think whatever you use, just stay consistent. then no one will care what order you use. Commented Jun 15, 2013 at 11:18
  • 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. Commented Jun 27, 2023 at 6:41