Hands on the brain

Source: Internet
Author: User

One

An enumeration type is a reference type, and the enumeration does not belong to the original data type, and each of his specific values refers to a specific object. The same value refers to the same object.

You can use the ' = = ' and Equals () methods to directly compare the values of the enumeration variables, in other words, the result of the "= =" and the Equals () methods are equivalent for variables of the enumerated type.

Two

Each variable has a corresponding scope and leaving this scope variable will no longer be valid. Two scopes have different names for the same variable, and do not cause conflicts.

publicclassqq {

     private static int code= 24 ;

     public static void main(String[] args) {

         int code=2 ;

         System.out.println(code);

     }

}The result of the output is 23. byte: 1 bytes -128~127 Short: 2 bytes -2^15~2^15-1 int: 4 bytes -2^31~2^31-1 Long: 8 bytes -2^63~2^63-1 Boolean: 1 bytes True False (cannot be replaced in Java by 0 or not 0) float: 4 bytes -3.403e38~3.403e38 Double: 8 bytes -1.798e308~-4.9E324 Char: 2 bytes ' \u0000 ' ~ ' \uffff ' (16 binary, converted to 0~65535) (1 bytes equals 8 bits) four

Output Result:

x+y=100200

300=x+y

Because +x+y indicates that only the values of X and Y are output, x+y represents the value of the output x+y.

Hands on the brain

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.