classAnimal{constructor(name){this.name = name;}sayHi(){return`My name is ${this.name}`;}}let a =newAnimal('Jack');console.log(a.sayHi());// My name is Jack
继承
使用 extends关键字实现继承,子类中使用super 关键字来调用父类的构造函数和方法。
classAnimal{public name:stringconstructor(name){this.name = name;}sayHi(){return`My name is ${this.name}`;}}classCatextendsAnimal{constructor(name:string){super(name);// 调用父类的 constructor(name)}sayHi(){return'Meow, '+super.sayHi();// 调用父类的 sayHi()}}
classAnimal{public name;publicconstructor(name){this.name = name;}}let a =newAnimal('Jack');console.log(a.name);// Jack
a.name ='Tom';console.log(a.name);// Tom
abstractclassAnimal{public name;publicconstructor(name){this.name = name;}publicabstractsayHi();}classCatextendsAnimal{publicsayHi(){// 实现抽象类的抽象方法console.log(`Meow, My name is ${this.name}`);}}let cat =newCat('Tom');
为了破解加密的zip文件,需要用到john进行爆破密码。 1、首先使用homebrew安装john,可以安装它的增强版john-jumbo:
brew install john-jumbo
2、安装后可以使用 john 命令验证: john 3、配置zip2john的环境——.zshrc下,&#x…