Why does C# not allow const and static on the same line?

前端 未结 5 710
一个人的身影
一个人的身影 2021-02-02 10:03

Why does C# not allow const and static on the same line? In Java, you must declare a field as \'static\' and \'final\' to act as a constant. Why does C# not let you declare co

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-02 10:48

    Constants by their nature are static, so that would be redundant.

提交回复
热议问题