摘要:
一般说,在基类中定义的访问基类中属性的方法,即使派生类覆盖他也不会造成影响,没懂😂? 我的意思是这个👇 举一个简单的例子 public class Person { private final String _name = "person"; public String getName() { 阅读全文
摘要:
观察者模式,又称为发布订阅模式,属于行为模式。 定义一对多的依赖关系,观察者和被观察者,订阅者发发布者的比喻都很形象。 java中对该模式有原生实现,这里贴上删除注释的代码 public interface Observer { void update(Observable o, Object ar 阅读全文
摘要:
對於csapp上面謀道習題,這是我的答案 #include <stdio.h> /** * Do rotating left shift. Assume 0 <= n < w * Examples when x = 0x12345678 and w = 32: * n = 4 -> 0x234567 阅读全文
摘要:
#include <stdio.h> int show_bytes(void *ptr, int length); int main() { int x = 0xff; show_bytes(&x, sizeof(int)); } int show_bytes(void *ptr, int leng 阅读全文