Home  >  Article  >  Backend Development  >  What are non-static classes in C#?

What are non-static classes in C#?

WBOY
WBOYforward
2023-09-10 22:49:11965browse

C# 中的非静态类是什么?

Non-static classes can be instantiated, but static classes cannot be instantiated, that is, you cannot use the new keyword to create variables of class type.

Non-static classes can have instance methods and static methods.

Use the class name itself to access members of a static class, and static classes are sealed.

Non-static class example -

public class Calculate

Static class example -

public static class Calculate

The above is the detailed content of What are non-static classes in C#?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete
Previous article:Generics in C#Next article:Generics in C#