1.了解父类和子类的关系: 在上述三行代码中,Animal是父类,而fish和Tortoise则是Animal的子类。 子类具有父类的全部功能,这种特性称为:继承 此外,从上面的代码可以看出,三个类都有run()方法。当子类和父类拥有相同的方法时,子类的方法会覆盖父类的方法。这中特性称为:多态 从左 ...
分类:
其他好文 时间:
2017-09-20 20:54:29
阅读次数:
138
1.泛型(generic) 参数化的类型,一般用来限制集合的内容 class Person { constructor(private name: string) { } work() { }}var worker: Array<Person> = [];//这里指定数组中只能放Person类创建的 ...
分类:
其他好文 时间:
2017-09-20 00:52:39
阅读次数:
167
使用 data-* 属性来嵌入自定义数据: <ul><li data-animal-type="bird">Owl</li><li data-animal-type="fish">Salmon</li> <li data-animal-type="spider">Tarantula</li> </u ...
分类:
Web程序 时间:
2017-09-19 23:00:46
阅读次数:
549
namespace Txst_2._1 { class Animal { private Boolean m_sex; private string m_sound; public Animal() { m_sex = false; m_sound = "Howl..."; } public boo ...
分类:
其他好文 时间:
2017-09-19 00:13:18
阅读次数:
124
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace Txst_2._1{ class Animal { pr ...
namespace Txst2_1{ class Animal { private Boolean m_sex; private int m_age; public bool Sex { get { return m_sex; } set { m_sex = false; } } public in ...
分类:
其他好文 时间:
2017-09-17 23:33:43
阅读次数:
345
namespace Txst2_1{ class Animal { private Boolean m_sex; private int m_age; public bool Sex { get { return m_sex; } set { m_sex = false; } } public in ...
namespace Txst_2._1{ class Animal { private Boolean m_sex; private string m_sound; public Animal() { m_sex = false; m_sound = "Howl..."; } public bool ...
分类:
其他好文 时间:
2017-09-17 23:29:56
阅读次数:
161
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace Txst2_1{ class Animal { priv ...
分类:
其他好文 时间:
2017-09-17 23:29:20
阅读次数:
169
1、 using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace Txst2_1{class Animal{priv ...