Java data type and equals, = = Difference __java

Source: Internet
Author: User

For Java basic data types, please refer to the blog: http://blog.csdn.net/bingduanlbd/article/details/27790287 java data type

The Java language is statically typed (statical typed), in other words, the type of all variables and expressions is completely determined when compiled.

Because it is statical typed, the Java language is also strongly typed (strong typed). A strong type means that each variable has a type, each of which has a type, and each type is strictly defined, and the type limits what values the variable can hold and what the expression ultimately produces. It also limits the types of operations that these values can take and the specific ways in which they are manipulated. All assignment operations, whether explicit or passed through parameters in a method call, are checked for type compatibility. base type (primitive types): Includes Boolean type and numeric type (numeric types), numeric types to integral type (integer Types) and floating-point type (floating-point type) reference type (reference types):

equals, = = Difference 1. Basic Data Types

Apply a double equal sign (= =), compare their values, and compare the memory addresses. 2. Composite data type (Class)

When compared with (= =), compare their store address in memory, so unless the same object is new, their comparison result is true, otherwise the result is false after comparison.

Equals is to determine if the value of the memory space that two variables or instances point to is the same

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.