C# 密封类使用sealed修饰

mac2022-06-30  30

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace @sealed { class Program { static void Main(string[] args) { } } public class Person { } //密封类 /**密封类特征: *1、不能够被其他类继承,但是可以继承其他类 */ public sealed class Teacher:Person { } }

 

转载于:https://www.cnblogs.com/zoro-zero/p/4058005.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)