Assignment operators in Java
An assignment operator is a symbol that specifies a numeric value for a variable or constant. If you can use "=" to assign the result of the right expression to the left operand.
Common assignment operators supported by Java, as shown in the following table:
650) this.width=650; "src=" http://img.mukewang.com/5360ebdb0001401b04430144.jpg "/>
Code:
public class helloworld{
public static void Main (string[] args) {
int one = 10;
int: 20;
int three = 0;
three = One+two;
System.out.println ("three= one+two ==>" + three);
three + = one;
System.out.println ("Three +=one ==>" + three);
Three-=one;
System.out.println ("Three-=one ==>" + three);
Three *=one;
System.out.println ("Three *= one ==>" + three);
Three/=one;
System.out.println ("Three/=one ==>" + three);
Three%=one;
System.out.println ("Three%=one ==>" + three);
Operation Result:
Three= One+two ==>30
Three +=one ==>40
Three-=one ==>30
Three *= one ==>300
Three/=one ==>30
Three%=one ==>0
This article is from "Ghost" blog, please make sure to keep this source http://caizi.blog.51cto.com/5234706/1547666
Assignment operator in Java Foundation--java (12)