我有这门课:
public class Stack {
private class Node {
String item;
Node next;
}
// some other methods here
}
在我的书中,作者说每个堆栈节点的大小是 40 字节,包括:
16 bytes (object overhead)
8 bytes (inner class extra overhead)
8 bytes (references to string)
8 bytes (references to node)
----------------------------------------------
40 bytes per stack node
我知道最后两件事是指对字符串和节点的引用的大小。但我不知道object overhead
andinner class extra overhead
对应什么。你能解释一下吗?