Câu hỏi phỏng vấn C#
Câu hỏi

What are the different types of classes in C#?

Câu trả lời

There are several types of classes in C#:

  1. Regular classes: These are the most common type of classes. They can be instantiated to create objects and can contain fields, properties, methods, events, and nested types[1][3].

  2. Abstract classes: Abstract classes are declared with the abstract keyword. They cannot be instantiated and are meant to be base classes for other classes to inherit from. Abstract classes can have abstract methods that derived classes must implement[1][3].

  3. Sealed classes: Sealed classes are declared with the sealed keyword. They cannot be inherited from and are typically used to prevent a base class from being overridden[1][3].

  4. Static classes: Static classes are declared with the static keyword. They can only contain static members and cannot be instantiated. Static classes are typically used for utility methods[1][3].

  5. Partial classes: Partial classes allow a class t...

junior

junior

Gợi ý câu hỏi phỏng vấn

entry

What is the difference between continue and break statements in C#?

middle

What is the difference between ref and out keywords?

expert

What is Multicast Delegate in C#?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào