What is a “static” class?

后端 未结 10 1457
面向向阳花
面向向阳花 2020-12-04 16:35

In C# what is the difference between:

public static class ClassName {}

And:

public class ClassName {}
10条回答
  •  广开言路
    2020-12-04 17:12

    You can't instantiate (create objects of) a static class. And it can only contain static members.

    Example: System.Math

提交回复
热议问题