Using Java Operators

Source: Internet
Author: User

Operator is based on one or more arguments to generate a new value. The argument takes a different form from the original method invocation, but the effect is the same.

The general concept of operators should not be difficult to understand, based on previous experience with writing programs.

The use of the plus (+), minus and minus sign (-), multiplication (*), Division (/), and equal sign (=) is similar to all other programming languages.

All operators can generate a value based on their own arithmetic object. In addition, an operator can change the value of an Operation object, which is called a "side effect" (Side Effect).

The most common use of operators is to modify their own operation objects, resulting in side effects. However, note that the generated value can also be generated by operators without side effects.

Almost all operators can only manipulate the "main type" (primitives). The only exceptions are "=", "= =" and "!=", which can manipulate all objects (which is also a confusing place for objects). In addition, the string class supports "+" and "+ +".

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.