摘要: 1、面向对象写法(带着面向过程的思维)电脑 computer = new 电脑(); 【电脑代码中 new 打印机()】computer.打印文本("hello 140"); 电脑和打印机告诉耦合 2、改进,电脑类中,不再new 打印机,采用注入方式电脑 computer = new 电脑();打印 阅读全文
posted @ 2017-10-17 14:48 沐念 阅读(103) 评论(0) 推荐(0) 编辑