Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> C#

Non-static Class (Lớp không tĩnh) trong C#

Non-static class có thể khởi tạo (instantiated), static class không thể khởi tạo (không dùng new tạo biến kiểu lớp).

Non-static class có thể có instance method và static method.

Truy cập thành viên static class qua tên lớp, static class là sealed.

Ví dụ non-static class:

public class Calculate

Ví dụ static class:

public static class Calculate