摘要:
wait(),notify()和notifyAll()都是java.lang.Object的方法: wait():Causes the current thread to wait until another thread invokes the notify() method or the not... 阅读全文
摘要:
C++创建对象有两种方式,在栈上创建对象(Objects on the Stack)和在堆上创建对象(Objects on the Heap)。 假设我们有以下的类: 1 #include 2 using std::string; 3 4 class SpreadsheetCell{ 5 ... 阅读全文
摘要:
The only operators that can't be overloaded are the operators forscope resolution (::),member selection (.), andmember selection through a pointer to a function(.*).Almost all operators can be overloaded in C++: + - * / % ^ & | ~ ... 阅读全文
摘要:
面试题很喜欢问的题目。找了一些资料,发现两者只有以下区别: 1.In absence of anaccess-specifierfor a base class, public is assumed when the derived class is declaredstructand privat... 阅读全文
摘要:
CyclicBarrier和CountDownLatch一样,都是关于线程的计数器。 用法略有不同,测试代码如下: 1 public class TestCyclicBarrier { 2 3 private static final int THREAD_NUM = 5; 4 ... 阅读全文