12 2013 档案

java 总结
摘要:equals vs == equals : always remember to override hashCode if you override equals so as not to "break the contract". if equals. the hashCode must be same.== : it returns true if both variables refer to the same object, if their references are one and the same.why in the abstract class, can 阅读全文

posted @ 2013-12-21 08:07 brave_bo 阅读(298) 评论(0) 推荐(0)

多线程
摘要:Thread safety A piece of code is thread-safe if it only manipulates shared data structures in a manner that guarantees safe execution by multiple threads at the same time. #include int increment_counter (){ static int counter = 0; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZ... 阅读全文

posted @ 2013-12-13 06:03 brave_bo 阅读(173) 评论(0) 推荐(0)

design a text edit
摘要:rope (data structure) + KMP(string search) O(m+n) 阅读全文

posted @ 2013-12-11 03:17 brave_bo 阅读(174) 评论(0) 推荐(0)

局部内部类为什么只能访问final局部变量?
摘要:局部内部类为什么只能访问final局部变量?分类:Java2012-01-07 14:03874人阅读评论(1)收藏举报stringthreadclassjava[html]view plaincopy//只有定义成finalStringobj才不会报错publicvoidtest(finalStringobj){ThreadmyThread=newThread(){publicvoidrun(){System.out.println(obj);}};myThread.start();}[html]view plaincopypublicclassOuterClass{publicvoidou 阅读全文

posted @ 2013-12-11 02:50 brave_bo 阅读(497) 评论(0) 推荐(0)

导航