Java Arithmetic operators

Source: Internet
Author: User
Tags arithmetic arithmetic operators
Arithmetic operators: generally referred to as subtraction operations. Add operations in Java use the symbol + to use the minus operation-the symbol indicates that the multiplication operation uses the * symbol to denote the use of the/symbol notation to use the% symbol notation (modulo is actually the operation two number division to get the remainder, if the two number is exactly divisible, then the remainder is 0) self-added operator: + + The operation is represented on the original basis + 1 for example int a=90;a++; then the a=91 decrement operator:--The decrement operator is represented on the original basis-1 for example int b=88;b--; then b=87 another example: int a=90;int b=++a; At this point a equals how many B equals how much, at this time a=91 B also equals 91int b=a++ and int b=++a What difference does it first look first int b=a++; It first assigns its own value to B and then only +1 and int b=++a; You first put yourself + 1 and then assign to the B left plus operator + = (Add a value based on the original value) for example: int a=90;a+=90; Represents a on the basis of the original 90 plus 90 left minus operator-= (minus a value on the original basis) left except operator/= left modulo operator%=

Java Arithmetic operators

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.