Value assignment operator-general Linux technology-Linux programming and kernel information. For more information, see the following section. In Chapter 2, you have used the value assignment operator. Next we will discuss it officially. The value assignment operator is an equal sign "= ". Its operations in Java are the same as those in other computer languages. The general format is:
Var = expression;
Here, the var variable must be of the same type as the expression.
The value assignment operator has an interesting attribute that you may not be familiar with: it allows you to assign values to a series of variables. For example, see the following example:
Int x, y, z; x = y = z = 100; // set x, y, and z to 100
In this example, a value assignment statement is used to assign values to all variables x, y, and z to 100. This is because the "=" operator generates the value of the right expression, so the value of z = 100 is 100, and then the value is assigned to y and assigned to x in turn. Assigning values to strings is a simple way to assign the same value to a group of variables.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service