摘要:
装饰模式(Decorator)最常见的就是JDK中的关于文件流的处理。 DataInputStream dis = = new DataInputStream(new BufferedInputStream(new FileInputStream("test.txt"))); 装饰... 阅读全文
摘要:
Python中的字典类似于Java中的Map,数据以键值对的形式存储。 字典可以用以下的方式使用: >>> phonebook = {"alice":"6100","bruce":"6230","beth":"9120"} >>> phonebook.get("alice") '6... 阅读全文