• TypeScript-04基础知识之类型操纵、类


    目录

    一、类型操纵

    1、泛型

            1、泛型类型、泛型接口及泛型类

            2、泛型约束

            3、在泛型中使用类型参数(keyof)

    2、keyof操作符

    3、typeof 类型操作符

     4、索引访问类型

    5、条件类型

             1、条件类型约束

            2、在条件类型中进行推理

    6、映射类型

            1、映射类型的修改器

    二、类

    1、类的属性与方法

            1、readonly修饰符

             2、构造器

            3、函数

            4、Getters / Setters

             5、索引签名

    2、类的继承

            1、implements子句

            2、extends子句

            3、重写方法

            4、父类与子类之间初始化的顺序

            5、继承内置类型

    3、成员可见性(public、protected、private)

            1、public

            2 protected

    4、静态成员

            1、特殊静态名称

    5、类中的static区块

    6、泛型类

    7、类运行时的this

    8、参数属性

    9、类表达式

     10、抽象类与成员


     

    一、类型操纵

            通过结合各种类型操作符,用一种简洁、可维护的方式来表达复杂的操作和值;用现有的类型或值来表达一个新类型的方法。

    • 泛型 —— 带参数的类型
    • Keyof 类型操作符 —— keyof 操作符创建新类型
    • Typeof 类型操作符 —— 使用 typeof 操作符来创建新的类型
    • 索引访问类型 —— 使用 Type['a'] 语法来访问一个类型的子集
    • 条件类型 —— 在类型系统中像if语句一样行事的类型
    • 映射类型 —— 通过映射现有类型中的每个属性来创建类型
    • 模板字面量类型 —— 通过模板字面字符串改变属性的映射类型

    1、泛型

            1、泛型类型、泛型接口及泛型类

    1. // 业务场景
    2. // 定义一个函数,这个函数将返回传入的任何参数(捕获参数的类型,以便返回内容)
    3. function returnType<Type>(data: Type): Type{
    4. return Type
    5. }
    6. // 调用该函数的方式
    7. // 方式一:显示指定函数接收 与 返回值 的类型
    8. let data = returnType<String>("Hello")
    9. // 方式一:不显式指定,使用隐式的类型推断
    10. let data = returnType("Hello")
    11. // ********************************泛型 类 与 接口************************************
    12. // 泛型接口
    13. interface GenericId<Type> {
    14. (arg: Type): Type;
    15. }
    16. function identity<Type>(arg: Type): Type {
    17. return arg;
    18. }
    19. let myIdentity: GenericId = identity
    20. // 泛型类
    21. class GenterId<Type>{
    22. id: Type;
    23. addId: (x: Type , y: Type) => Type
    24. }
    25. let newGenterId = new GenterId<Number>;
    26. newGenter.id = 1123432;
    27. newGenter.addId = function(x,y){
    28. return (x+y)*10;
    29. }

            2、泛型约束

    1. function identity<Type>(arg: Type): Type {
    2. console.log(arg.length) // 会报语法错误,因为typescript会自动推断且不能保证arg是否包含length属性
    3. }
    4. // 给上述代码添加 类型限制
    5. interface hasLength {
    6. length: number
    7. }
    8. function identity<Type extends hasLength>(arg: Type): Type {
    9. console.log(arg.length) // 做了类型限制(不管传递什么值,都要有length这个属性,否则在函数调用的时候就会报错),就不会报错了
    10. }

            3、在泛型中使用类型参数(keyof)

            声明一个受另一个类型参数约束的类型参数。例如,在这里从一个给定名称的对象中获取 一个属性值。

            确保不会意外地获取一个不存在于 对象 上的属性,所以我们要在这两种类型之间放置一个约束条件。

    1. // 这里的 Key extends keyof Type 表示Key的类型值,只能式Type类型中的key值
    2. function getProp<Type,Key extends keyof Type>(obj: Type,key: Key){
    3. return obj[key]
    4. }
    5. // 这个key值,只能是'a','b','c'中的一个,其他的值都会报错
    6. console.log(getProp({'a':1111,'b':2222, 'c':3333},'a'));

    2、keyof操作符

    •         keyof 运算符接收一个对象类型,并产生其的字符串或数字字面联合("x"|"y ")。
    •         如果该类型有一个字符串或数字索引签名, keyof 将返回这些索引的类型。
    1. type Point = { x: number; y: number };
    2. type P = keyof Point; // 这里的P的类型为 'x'|'y'
    3. const p1:P = 'x'
    4. const p2:P = 'y'
    5. // 当一个对象有索引时,keyof 的值就是其索引对应的值
    6. type Arrayish = { [n: number]: unknown };
    7. type A = keyof Arrayish;
    8. const a:A = 0
    9. // M 是 string|number 是因为JavaScript对象的键总是被强制为字符串,所以 obj[0] 总是与 obj["0"] 相同
    10. type Mapish = { [k: string]: boolean };
    11. type M = keyof Mapish;
    12. const m:M = 'a'
    13. const m2:M = 1

    3、typeof 类型操作符

    在JavaScript中typeof是用来判断对象类型的。TypeScript添加了一个 typeof 操作符,可以在类型上下文中使用它来引用一个变量或属性的类型

    1. let s = "hello";
    2. let n: typeof s;
    3. n = 'world'
    4. n= 100 // 报错,n的类型是string

     4、索引访问类型

    1. ype Person = { age: number; name: string; alive: boolean };
    2. type Age = Person["age"]; // 这个时候Age的类型就是索引age对应的类型number
    3. let A: Age = 100; // 正确
    4. let B: Age = '100'; // 错误

    索引类型本身就是一个类型,所以可以使用 unions、 keyof 或者其他类型。

    1. interface Person {
    2. name: string,
    3. age: number,
    4. alive: boolean
    5. }
    6. // 索引 => 联合类型
    7. // I 的类型为 number | boolean
    8. type I = Person['age' | 'alive']
    9. // 索引 => keyof操作符
    10. // I 的类型为 string | number | boolean
    11. type I = Person[keyof Person];

    5、条件类型

    1. interface Animal {
    2. live: void()
    3. }
    4. interface Dog extends Animal {
    5. wfun: void
    6. }
    7. // 通过条件表达式动态决定类型
    8. // type expl1 = number
    9. type expl1 = Dog extends Animal ? number : string
    10. // type expl1 = string
    11. type expl2 = Date extends Animal ? number : string

             1、条件类型约束

            条件类型中的检查会给一些提示信息。就像用类型守卫缩小范围那样给一个更具体的类型一样,条件类型的真正分支将通过检查的类型进一步约束泛型。

    1. // 会报语法错误: T没有索引message
    2. type MessageOf = T["message"]
    3. // 给T做一个类型限制就可以了
    4. type MessageOfextends {message: unknown}> = T["message"]
    5. // 使用条件类型去判断,也可对T进行类型限制
    6. type MessageOf = T extends { message: unknown } ? T["message"] : never;
    7. interface Email {
    8. message: string;
    9. }
    10. interface Dog {
    11. bark(): void;
    12. }
    13. // type EmailMessageContents = string
    14. type EmailMessageContents = MessageOf<Email>;
    15. // type DogMessageContents = never
    16. type DogMessageContents = MessageOf<Dog>;

            2、在条件类型中进行推理

            条件类型提供了一种方法来推断在真实分支中使用 infer 关键字进行对比的类型。

    1. // 可以在 Flatten 中推断出元素类型,而不是用索引访问类型 "手动 "提取出来。
    2. type Flatten<Type> = Type extends ArrayItem> ? Item :Type;

             使用 infer 关键字来声明性地引入一个名为 Item 的新的通用类型变量,而不是指定如 何在真实分支中检索 T 的元素类型。 可以使用 infer 关键字编写一些有用的辅助类型别名。

            3、分布式条件类型

            当给条件类型定义的新类型传入一个联合类型时,就会变成分布式

    1. type toArray<Type> = Type extends any ? Type[] : never
    2. // 给toArray传入一个联合类型,得到的新类型为 type newData = String[] | Number[]
    3. type newData = toArray<String | Number>
    4. // 如果想要避免得到这样 String[] | Number[] 类型,可以对toArray做个调整
    5. type toArray<Type> = [Type] extends [any] ? Type[] : never
    6. // type newData = (String | Number)[]
    7. type newData = toArray<String | Number>

    6、映射类型

    映射类型是一个通用类型,他使用PropertyKeys(就是利用keyof),迭代键来创建一个类型

    1. type optionKeys<Type> = {
    2. [Property in keyof Type]: boolean
    3. }
    4. type transferData = {
    5. getData: () => void,
    6. returnData: () => void
    7. }
    8. // 使用optionKeys 和 transferData 创建一个新的类型
    9. // type newType = {getData: boolean, returnData: boolean}
    10. type newType = optionKeys

            1、映射类型的修改器

    在映射过程中,有两个额外的修饰符可以应用: readonly ? ,它们分别影响可变性和可选性。 你可以通过用 -+ 作为前缀来删除或添加这些修饰语。如果你不加前缀,那么就假定是 + (默认值)

    1. type CreateMutable<Type> = {
    2. // 从一个类型的属性中删除 "readonly"属性
    3. -readonly [Property in keyof Type]: Type[Property];
    4. };
    5. type LockedAccount = {
    6. readonly id: string;
    7. readonly name: string;
    8. };
    9. /*
    10. type UnlockedAccount = {
    11. id: string;
    12. name: string;
    13. }
    14. */
    15. type UnlockedAccount = CreateMutable<LockedAccount>;
    16. // 从一个类型的属性中删除 "可选" 属性
    17. type Concrete<Type> = {
    18. [Property in keyof Type]-?: Type[Property];
    19. };
    20. type MaybeUser = {
    21. id: string;
    22. name?: string;
    23. age?: number;
    24. };
    25. /*
    26. type User = {
    27. id: string;
    28. name: string;
    29. age: number;
    30. }
    31. */
    32. type User = Concrete<MaybeUser>;

            2、通过as做key的重映射

    在TypeScript 4.1之后的版中,都可以使用as重新映射映射类型中的键

    1. type MapNewKeyOfMap<Type> = {
    2. [Property in keyof Type as newType]: Type[Property]
    3. }
    4. // 可以利用其他功能,从先前的属性名称中创建新的属性名称。
    5. type Getters<Type> = {
    6. [Property in keyof Type as `get${Capitalize<string & Property>}`]: () => Type[Property]
    7. };
    8. interface Person {
    9. name: string;
    10. age: number;
    11. location: string;
    12. }
    13. /*
    14. type LazyPerson = {
    15. getName: () => string;
    16. getAge: () => number;
    17. getLocation: () => string;
    18. }
    19. */
    20. type LazyPerson = Getters<Person>

    二、类

    1、类的属性与方法

    TypeScript  对  ES2015中的  class  关键字完全支持。

            与其他JavaScript语言功能一样,TypeScript增加类型注释其他语法,允许你表达类和其他类型之间的关系

    1. // 声明并初始化属性的两种方式 (如果只声明,不初始化就会报错)
    2. // 方式一
    3. class pointer {
    4. x: number = 0
    5. y: number = 0
    6. }
    7. // 方式二,在constructor函数中初始化
    8. class pointer {
    9. x: number
    10. y: number
    11. constructor(){
    12. this.x = 0
    13. this.y = 0
    14. }
    15. }

            1、readonly修饰符

    字段的前缀可以是 readonly 修饰符。这可以防止在构造函数之外对该字段进行赋值

    1. class Greeter {
    2. readonly name: string = "world";
    3. constructor(otherName?: string) {
    4. if (otherName !== undefined) {
    5. this.name = otherName; // name 只读属性的值只能在 constructor 函数中被修改
    6. }
    7. }
    8. err() {
    9. this.name = "not ok"; // name是只读属性,重新修改他的值会报错
    10. }
    11. }
    12. const g = new Greeter();
    13. g.name = "also not ok"; // name是只读属性,重新修改他的值会报错

             2、构造器

    类构造函数与函数非常相似,可以添加带有类型注释的参数、默认值和重载:

    1. class Point {
    2. x: number;
    3. y: number;
    4. // 带默认值的正常签名
    5. constructor(x = 0, y = 0) {
    6. this.x = x;
    7. this.y = y;
    8. }
    9. }
    10. class Point {
    11. // 重载
    12. constructor(x: number, y: string);
    13. constructor(s: string);
    14. constructor(xs: any, y?: any) {
    15. // ...
    16. }
    17. }

    Super 调用 :

            就像在JavaScript中一样,如果你有一个基类,在使用任何 this. 成员之前,你需要在构造器主体中调 用 super()。

    1. class A {
    2. data: String = "Hello"
    3. }
    4. class B extends A {
    5. dataB: String
    6. constructor(){
    7. super()
    8. this.dataB = "world"
    9. }
    10. }

            3、函数

    注意:在类的方法体中,仍然必须通过 this 访问字段和其他方法。

    1. class Point {
    2. x = 10;
    3. y = 10;
    4. scale(n: number): void {
    5. this.x *= n;
    6. this.y *= n;
    7. }
    8. }

            4、Getters / Setters

    1. class A {
    2. _data = 0
    3. get data(){
    4. return this._data
    5. }
    6. set data(value){
    7. this._data = value
    8. }
    9. }

    注意:一个没有额外逻辑的字段支持的 get/set 对在JavaScript中很少有用。如果你不需要在 get/set 操作中添加额外的逻辑,暴露公共字段也是可以的。

    TypeScript对访问器有一些特殊的推理规则:

    • 如果存在 get ,但没有 set ,则该属性自动是只读的
    • 如果没有指定 setter 参数的类型,它将从 getter 的返回类型中推断出来
    • 访问器和设置器必须有相同的成员可见性

             5、索引签名

    类可以声明索引签名;这些签名的作用与其他对象类型的索引签名相同。

    1. class MyClass {
    2. [s: string]: boolean | ((s: string) => boolean);
    3. check(s: string) {
    4. return this[s] as boolean;
    5. }
    6. }

    2、类的继承

            1、implements子句

    使用 implements 去继承接口。如果一个类不能正确地实现去实现接口,就会发出一个错误(将接口内的所有方法重写一遍)。

    1. interface Pingable {
    2. ping(): void;
    3. }
    4. class Sonar implements Pingable {
    5. ping() {
    6. console.log("ping!");
    7. }
    8. }
    9. // 这个类 Ball 会报错,因为没有实现接口中的方法ping
    10. class Ball implements Pingable {
    11. pong() {
    12. console.log("pong!");
    13. }
    14. }

    注意:

            重要的是要明白, implements 子句只是检查类是否可以被当作接口类型来对待。它根本不会改变类型或其方法。一个常见的错误来源是认为 implements 子句会改变类的类型

    1. interface Checkable {
    2. check(name: string): boolean;
    3. }
    4. class NameChecker implements Checkable {
    5. check(s) {
    6. // 接口不会影响类实现时的参数类型,所以这里的s 有 any类型的隐式转换,所以s不能调用toLowercse 这个方法
    7. return s.toLowercse() === "ok";
    8. }
    9. }
    10. // 假如接口中存在可选属性,那么类在实现这个接口的时候写不写都不影响,但是如果不实现的话,这个类在实例化的时候就不能调用接口那个可选参数
    11. interface A {
    12. x: number;
    13. y?: number;
    14. }
    15. class C implements A {
    16. x = 0;
    17. }
    18. const c = new C();
    19. c.y = 10; // 会报错,因为类C没有实现可选参数y,故可选参数y不能被其实例化对象调用

            2、extends子句

    类与类之间的继承关系可以使用关键字extends去实现

    1. class Animal {
    2. move() {
    3. console.log("Moving along!");
    4. }
    5. }
    6. class Dog extends Animal {
    7. woof(times: number) {
    8. for (let i = 0; i < times; i++) {
    9. console.log("woof!");
    10. }
    11. }
    12. }
    13. const d = new Dog();
    14. // 父类的类方法
    15. d.move();
    16. // 子类的类方法
    17. d.woof(3);

            3、重写方法

            子类也可以覆盖父类的一个字段或属性。你可以使用 super. 语法来访问父类方法

    注意:

            因为 JavaScript类是一个简单的查找对象,没有 "超级字段 "的概念。

    1. class Base {
    2. greet() {
    3. console.log("Hello, world!");
    4. }
    5. }
    6. class Derived extends Base {
    7. // 重写父类的方法greet 正常greet这个函数是跟父类一致的应该没有参数的,所以name用的是可选参数,如果不是的话,则不属于重写,而是重新定义的一个新的函数
    8. greet(name?: string) {
    9. if (name === undefined) {
    10. super.greet();
    11. } else {
    12. console.log(`Hello, ${name.toUpperCase()}`);
    13. }
    14. }
    15. }
    16. const d = new Derived();
    17. d.greet();
    18. d.greet("reader");

            4、父类与子类之间初始化的顺序

    1. class Base {
    2. name = "base";
    3. constructor() {
    4. console.log("My name is " + this.name);
    5. }
    6. }
    7. class Derived extends Base {
    8. name = "derived";
    9. constructor() {
    10. super()
    11. console.log("My name is " + this.name);
    12. }
    13. }
    14. // 打印 "My name is base",然后才是 "My name is derived"
    15. const d = new Derived();

    按照JavaScript的定义,类初始化的顺序是:

    •         父类的字段被初始化
    •         父类构造函数运行
    •         子类的字段被初始化
    •         子类构造函数运行

    这意味着基类构造函数在自己的构造函数中看到了自己的name值,因为派生类的字段初始化还没有运 行。

            5、继承内置类型

    在继承内置类型的时候,子类在实例化一个新的对象,并使用这个对象调用类中的方法的时候可能会出现“xxx is not a function”这个错误。这个时候需要在子类的构造函数中进行特殊操作

    1. class MsgError extends Error {
    2. constructor(m: string) {
    3. super(m);
    4. // 明确地设置原型。(不明确设置原型,在实例化对象之后调用sayHello方法会有运行时错误)
    5. Object.setPrototypeOf(this, MsgError.prototype)
    6. }
    7. sayHello() {
    8. return "hello " + this.message;
    9. }
    10. }

    3、成员可见性(public、protected、private)

            1、public

            类成员的默认可见性是公共( public )的。一个公共( public )成员可以在任何地方被访问。 因为 public 已经是默认的可见性修饰符,所以你永远不需要在类成员上写它,但为了可读性的原 因,可能会选择将其写上。

            2 protected

            受保护的( protected )成员只对它们所声明的类的子类可见

    1. class Greeter {
    2. public greet() {
    3. console.log("Hello, " + this.getName());
    4. }
    5. protected getName() {
    6. return "hi";
    7. }
    8. class SpecialGreeter extends Greeter {
    9. public howdy() {
    10. // 在此可以访问受保护的成员
    11. console.log("Howdy, " + this.getName());
    12. }
    13. }
    14. const g = new SpecialGreeter();
    15. g.greet(); // 没有问题
    16. g.getName(); // 报错 无权访问

    受保护成员的暴露

             子类需要遵循它们的父类契约,但可以选择公开具有更多能力的父类的子类型。这包括将受保护的成 员变成公开(感觉像废话,其实就是在子类中直接将父类受保护的属性直接定义为公共的就可以实现其成员的暴露)

    1. lass Base {
    2. protected m = 10;
    3. }
    4. class Derived extends Base {
    5. // 没有修饰符,所以默认为'公共'('public') 也就实现了方法的暴露
    6. m = 15;
    7. }
    8. const d = new Derived();
    9. console.log(d.m); // OK

            3、private

    private 和 protected 一样,但不允许从子类中访问该成员。 私有( private )成员对子类是不可见的,所以子类不能增加其可见性。

    4、静态成员

    类可以有静态成员。这些成员并不与类的特定实例相关联。它们可以通过类的构造函数对象本身来访问

    1. class MyClass {
    2. static x = 0;
    3. static printX() {
    4. console.log(MyClass.x);
    5. }
    6. }
    7. // 类中的静态成员,只能类本身访问,不与类的实例对象相关联
    8. console.log(MyClass.x);
    9. MyClass.printX();

    1. // 静态成员也可以使用相同的 public 、 protected 和 private 可见性修饰符。
    2. class MyClass {
    3. private static x = 0;
    4. static printX() {
    5. console.log(MyClass.x);
    6. }
    7. }
    8. // 静态成员也会被继承。
    9. class Base {
    10. static getGreeting() {
    11. return "Hello world";
    12. }
    13. }
    14. class Derived extends Base {
    15. myGreeting = Derived.getGreeting();
    16. }

            1、特殊静态名称

            函数原型覆盖属性是不安全的。因为类本身就是可以用 new 调用的函数,所以某些静态名称不能使用。像 name 、 length 和 call 这样的函数属性(都属于其内置属性),定义为静态成员是无效的。

    5、类中的static区块

            静态块允许写一串有自己作用域的语句,可以访问包含类中的私有字段。这意味着我们可以用写语句的所有能力来写初始化代码,不泄露变量,并能完全访问我们类的内部结构。

    1. class Foo {
    2. static #count = 0; // 私有字段count,#只能在es2015之后使用
    3. get count() {
    4. return Foo.#count;
    5. }
    6. // 静态区块
    7. static {
    8. try {
    9. const lastInstances = {
    10. length: 100
    11. };
    12. Foo.#count += lastInstances.length;
    13. }
    14. catch {}
    15. }
    16. }

    6、泛型类

            类可以像接口一样使用通用约束默认值。 静态成员中的类型参数

    1. class Box<Type> {
    2. // 报错 静态成员不能引用类的类型参数。
    3. static defaultValue: Type;
    4. }
    5. // Box.defaultValue = 'hello'
    6. // console.log(Box.defaultValue

    7、类运行时的this

            TypeScript并没有改变JavaScript的运行时行为,而JavaScript的运行时行为偶尔很奇 特。 比如,JavaScript对这一点的处理确实是不寻常的

    1. class MyClass {
    2. name = "MyClass";
    3. getName() {
    4. return this.name;
    5. }
    6. }
    7. const c = new MyClass();
    8. const obj = {
    9. name: "obj",
    10. getName: c.getName,
    11. };
    12. // 输出 "obj", 而不是 "MyClass" this指向很奇特
    13. console.log(obj.getName());
    14. // 想要解决这种this指向问题的方法如:
    15. // 1、在类中定义方法时,使用箭头函数
    16. class MyClass {
    17. name = "MyClass";
    18. getName = () => {
    19. return this.name;
    20. };
    21. }
    22. const c = new MyClass();
    23. const obj = {
    24. name: "obj",
    25. getName: c.getName,
    26. };
    27. // 输出 "MyClass"
    28. console.log(obj.getName());
    29. // 2、this参数
    30. // 在方法或函数定义中,一个名为 this 的初始参数在TypeScript中具有特殊的意义。这些参数在编译过程中会被删除
    31. class MyClass {
    32. name = "MyClass";
    33. getName(this: MyClass) {
    34. return this.name;
    35. };
    36. }
    37. const c = new MyClass();
    38. // 输出 "MyClass"
    39. console.log(c.getName());

    8、参数属性

            TypeScript提供了特殊的语法,可以将构造函数参数变成具有相同名称和值的类属性。这些被称为参数属性,通过在构造函数参数前加上可见性修饰符 public 、 private 、protected 或 readonly 中的一 个来创建。

    1. class Params {
    2. // 参数属性
    3. constructor(public readonly x: number, protected y: number, private z: number)
    4. {
    5. // ……
    6. }
    7. }
    8. const a = new Params(1, 2, 3);
    9. // (property) Params.x: number
    10. console.log(a.x);
    11. console.log(a.z

    9、类表达式

            类表达式与类声明非常相似。唯一的区别是,类表达式不需要一个名字,可以通过它们最终绑定的任何标识符来引用它们。

    1. const someClass = class<Type> {
    2. content: Type;
    3. constructor(value: Type) {
    4. this.content = value;
    5. }
    6. };
    7. // const m: someClass
    8. const m = new someClass("Hello, world")

     10、抽象类与成员

            抽象的方法或抽象的字段是没有提供实现的方法或字段。这些成员必须存在于一个抽象类中, 不能直接实例化。 抽象类的作用是作为子类的父类,实现所有的抽象成员。

    1. abstract class Base {
    2. abstract getName(): string;
    3. printName() {
    4. console.log("Hello, " + this.getName());
    5. }
    6. }
    7. // const b = new Base(); //这是错误的,抽象类不能直接被实例化
    8. class Derived extends Base {
    9. getName() {
    10. return "world";
    11. }
    12. }
    13. const d = new Derived(); // 继承抽象类Base,并将抽象类中的所有抽象方法都给重写了,不然会报错
    14. d.printName()
  • 相关阅读:
    无人机探测技术,无人机侦测频谱仪技术实现详解
    入门力扣自学笔记126 C++ (题目编号1302)
    政务数据质量管理提升的5个最佳实践
    在 SAP Fiori Launchpad 里给需要执行的 SAPGUI 事物码配置系统别名
    光明源@智慧公厕的卫生安全与隐私平衡!
    openssl生成key和pem文件
    二叉树问题——对称二叉树
    部署elasticsearch需要调整的系统参数
    MSTP&VRRP协议
    java 面试题
  • 原文地址:https://blog.csdn.net/m0_51992766/article/details/127991606