“=”(等号)前后的术语名称?

Name of terms before and after "=" (equal sign)?

等号前后的术语名称是什么?

示例:

student1 = John;
height = 100.0;
hasLight = false;

之前:student1,身高,hasLight。 之后:约翰,100.0,错误。

我认为等号后面的词是"value",但不确定它是否正确。

您正在做 assignment:

例如,您将值 100.0 赋给第 2 行的变量高度

它们都是 "operands" 赋值运算符¹ (=)。

右边的操作数可能被粗略地称为正在赋值的 "value",尽管更准确地说它是一个表达式,并且它是被赋值的表达式的结果值。

左边的操作数通常称为赋值的 "target",有时称为 "assignee."


¹ 我从上下文中假设它是一个赋值运算符。一些语言使用 = 来测试相等性(例如,if (height = 100.0))。如果它是一个相等运算符而不是赋值运算符,那么它们只是 "operands" 而上面的其他两个术语不适用。

赋值运算符左边是变量。右边是表达式,在你的例子中都是文字值。

不太笼统的术语也可以是: Variable/Constant = 值;

来自 MSDN 的更多姓名:

The assignment operator (=) stores the value of its right-hand operand in the storage location, property, or indexer denoted by its left-hand operand and returns the value as its result.