Why does C# not allow const and static on the same line?
Posted
by Cuga
on Stack Overflow
See other posts from Stack Overflow
or by Cuga
Published on 2009-05-09T03:51:21Z
Indexed on
2010/04/15
20:53 UTC
Read the original article
Hit count: 208
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 const's as final?
I make the further distinction that in Java, every interface is public and abstract, whether this is explicitly declared or not. Aren't const's effectively static in nature? WHy does C# balk at this?
© Stack Overflow or respective owner