摘要:Composition means HAS AInheritance means IS A Example: Car has a Engine and Car is a Automobile In programming this is represented as: Encapsulation i
阅读全文
摘要:An enum type is a special data type that enables for a variable to be a set of predefined constants. The constructor of enum must be private. It means
阅读全文
摘要:Typically, in each process, the virtual memory available to that process is called itsaddress space. Each process's address space is typically organiz...
阅读全文
摘要:HashTable is a data structure that maps key to values. No-null object is allowed by both key and value. In the context of a hash table, the term "coll
阅读全文
摘要:浅析Java中的final关键字 谈到final关键字,想必很多人都不陌生,在使用匿名内部类的时候可能会经常用到final关键字。另外,Java中的String类就是一个final类,那么今天我们就来了解final这个关键字的用法。下面是本文的目录大纲: 一.final关键字的基本用法 二.深...
阅读全文
摘要:静态变量和静态方法都属于静态对象,它与非静态对象的差别需要做个说明。 (1)Java静态对象和非静态对象有什么区别? 比对如下: 静态对象 非静态对象 拥有属性: 是类共同拥有的 是类各对象独立拥有的内存分配: 内存空间上是固定的 空间在各个附属类里面分配 分配顺序: 先分配静态对象的空间 继而再对
阅读全文
摘要:return在Java void方法里代表方法的终止。
阅读全文
摘要:Internally, both classes use array. Vector by default double the array size when array is full, while ArrayList increases the array size by 50%.Vector...
阅读全文
摘要:DP——“下一步最优是从当前最优得到的”。最优可以是“longest", "shortest"等等。贪心——为了计算最终的最优解,需要计算当前的最优解递推——类似于斐波那契序列作者:王勐链接:http://www.zhihu.com/question/23995189/answer/35429905...
阅读全文
摘要:空间复杂度就是为了支持你的计算所必需存储的状态最多有多少,时间复杂度就是从初始状态到达最终状态中间需要多少步。
阅读全文
摘要:i seq, int target){ int lo = 0; int hi = seq.size() - 1; while(lo < hi) { int mid = lo + (hi - lo) / 2; if(seq.get(mid) < t...
阅读全文
摘要:An abstract class can have shared state or functionality. An interface is only a promise to provide the state or functionality. A good abstract class ...
阅读全文
摘要:HashMap usually performs search operations bounded with complexity of O(1)<=T(n)<=O(n). BST performs search operations in O(logN)<=T(n)<=O(N).HashMap ...
阅读全文
摘要:vector is like ArrayList in Java.vector:Continuous memory.Underlying array implementation.Pre-allocate space for future element. This means extra spac...
阅读全文
摘要:1 /** 2 * The array buffer into which the elements of the ArrayList are stored. 3 * The capacity of the ArrayList is the length of this...
阅读全文