Java:定义术语初始化,声明和赋值 [英] Java: define terms initialization, declaration and assignment
问题描述
我发现defs是圆形的,主语是由他们的动词定义的,但动词是未定义的!那么你如何定义它们呢?
I find the defs circular, the subjects are defined by their verbs but the verbs are undefined! So how do you define them?
循环定义
初始化:初始化变量。它可以在
声明时完成。
initialization: to initialize a variable. It can be done at the time of declaration.
赋值:为变量赋值。它可以在任何地方完成,只有最终标识符一次。
assignment: to assign value to a variable. It can be done anywhere, only once with the final-identifier.
声明:为变量声明值。
[更新,试图理解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?
推荐答案
作业:扔掉变量的旧值并用新值替换
assignment: throwing away the old value of a variable and replacing it with a new one
初始化:这是一种特殊的赋值:第一种。在初始化对象具有 null
值之前,基元类型具有默认值,例如 0
或 false
。可以与声明一起完成。
initialization: it's a special kind of assignment: the first. Before initialization objects have null
value and primitive types have default values such as 0
or false
. Can be done in conjunction with declaration.
声明:声明声明变量的类型及其名称。变量只能声明一次。编译器使用它来帮助程序员避免错误,例如将字符串值赋给整数变量。在读取或分配变量之前,必须声明该变量。
declaration: a declaration states the type of a variable, along with its name. A variable can be declared only once. It is used by the compiler to help programmers avoid mistakes such as assigning string values to integer variables. Before reading or assigning a variable, that variable must have been declared.
这篇关于Java:定义术语初始化,声明和赋值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!