例如定义一个Java类:
public example{
public double[] instants = new double[100];
public int label;
}
或者是一个C的struct:
struct example
{
double instants[100];
int label;
}
在以上两种情况下,这个类(或结构)的实例占用的内存是不是:100 * size of double + size of int?
例如定义一个Java类:
public example{
public double[] instants = new double[100];
public int label;
}
或者是一个C的struct:
struct example
{
double instants[100];
int label;
}
在以上两种情况下,这个类(或结构)的实例占用的内存是不是:100 * size of double + size of int?