我有这样的数组声明:
int a[];
Run Code Online (Sandbox Code Playgroud)
这a是一个原始int类型的数组.这个数组存储在哪里?它是存储在堆还是堆栈上?这是一个原始类型int,所有原始类型都不存储在堆上.
我发现defs是圆形的,主语是由他们的动词定义的,但动词是未定义的!那么你如何定义它们呢?
通函定义
初始化:初始化变量.它可以在声明时完成.
赋值:为变量赋值.它可以在任何地方完成,只有最终标识符一次.
声明:向变量声明值.
[更新,尝试用lambda calc理解主题]
D(x type) = (?x.x is declared with type)
A(y D(x type)) = (?y.y is assigned to D(x type))
%Then after some beta reductions we get initialization.
D(x type) me human // "me" declared with type "human"
A(y (D(x type) me human)) asking // "asking" assigned to the last declaration
%if the last two statemets are valid, an initialization exists. Right?
Run Code Online (Sandbox Code Playgroud) 每当我在java中发起一个列表时,我都会这样做
List<Integer> list = new LinkedList<>();
Run Code Online (Sandbox Code Playgroud)
我假设这将在堆上分配列表.不知道我是否可以在堆栈上分配列表?