摘要: 严格来说,javascript没有类,但为了便于理解,我们将类和对象当做同一个概念来说。javascript有很多种定义类的方式,这还真有点狗血,选择太多必然增加了语言的复杂度,所以我们需要评估、选择合适的方式。类或对象定义我们先看看JAVA类定义方式class Car { public String color = "blue"; public int doors = 4; public int mpg = 25; public Car(String color, int doors, int mpg) { this.color = color; this.doors = 阅读全文
posted @ 2013-11-13 13:59 LaoHoo 阅读(390) 评论(0) 推荐(0)