首页 > 其他 > 详细

接口的理解

时间:2017-05-07 21:38:47      阅读:251      评论:0      收藏:0      [点我收藏+]
interface ClockInterface {
    new (hour: number, minute: number): ClockInterface;
}

class MyArray1 <M>{
    val: M;
    set(num: M){
        this.val = num;
    }
    get(){
       return this.val;
    }
}

var num = 1234;
var arr = 2222;

let a1 = new MyArray1<number>();
a1.set(num);

let a2 = new MyArray1<string>();
a2.set(arr);

let aa = a1.get();
aa.toFixed(2)
a2.get().toLocaleUpperCase();

 

接口的理解

原文:http://www.cnblogs.com/y896926473/p/6822391.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!