这次说一说面向对象与面向过程的区别以及面向对象的优点. 听一听用面向过程思想编程的程序员写程序时的心声:What are the things this program has to do? What procedures do we need? 啊哈,作为一名合格的准java程序员的我的想法是:What are the things in this program......who are the key players? 从中,可以形象的体现出面向对象与面向过程的区别.面向过程写程序时,关心
/* class A implements Comaprable<A>{ } 那么 A x = new A(); 类关系图 Object o = A; Object Comparable c = A; | Comparable A 实现了 Comparable 接口嘛 |-----|-----A 所以有 o instanceof A == true; o instanceof Comparable == true; 例如ArrayList添加对象实例时,对象实例添加之后先向上转型为Object