摘要: 前几天在学习javascript的面向对象编程,像我这种习惯于java式面向对象的人,在刚接触javascript时,还真是非常不适应,比如一个典型对象的结构://构造函数function Complex(real ,imaginary){ this.x = real; this.y = imaginary; }//实例方法Complex.prototype.toString = function(){ return "{"+this.x +","+this.y+"}";}Complex.prototype.add = functio 阅读全文
posted @ 2011-08-04 22:29 lengyuhong 阅读(781) 评论(0) 推荐(0) 编辑