It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center
                            
                        
                    
                
                                已关闭8年。
            
                    
在C#类声明中:

class thing
{
    ...
}


为什么在类声明的末尾我必须不包括分号?确实与C ++不同。您可以看到Why must I put a semicolon at the end of a class declaration in C++?

最佳答案

因为那是what the language specification说的。

请记住,C#在设计时并未考虑任何C ++兼容性。语言设计师只是简单地决定,不需要结尾的分号。

09-07 01:18