Java Foundation Bi Xiangdong day02

Source: Internet
Author: User

1. Constants

Null and other Special

2. Identifiers

Numbers-letters-underscores, numbers cannot start

3. Binary

1> binary calculation method.

2> is commonly used in binary.

1 1 0 0 1 1 0

128 64 32 18 8 4 2

4. Binary conversion

1> octal: Three binary consists of an octal bit. Starting with 0 means 032 means octal.

Hex: Four bits make up a 16 binary bit. The start is in 0x, and 0x represents hexadecimal.

Why is there no 32 binary?

Because the system is meant to represent data convenience, it is not used to indicate that the data is complex. The range of 16 binary representation numbers is 0-9,a-f.

And 32 is 0-9,a-w, that is, the data is not very convenient.

Calculation of 2> Binary

4+5 = 9

100

+ 101

——————————————————

10 01 = 9

3>

* Number of representations in memory 4+5

0000 0000 0000 0000 0000 0000 0000 0100

0000 0000 0000 0000 0000 0000 0000 0101

-------------------------------------------------------------------------

0000 0000 0000 0000 0000 0000 0000 1001

*4-5 in-Memory representation:

0000 0000 0000 0000 0000 0000 0000 0100

1111 1111 1111 1111 1111 1111 1111 1100

-------------------------------------------------------------------------

10000 0000 0000 0000 0000 0000 0000 0000

Note:
6 of the original code is 00000110
6 's inverse code is 11111001.
Negative number after code +1
11111010
This is-6

Naming conventions in 5.java:

Package name to lowercase

Class name Leiming hump name, first letter capitalized.

Method Name: First letter lowercase, followed by uppercase letters. SetData ();

Constant: Max_count

Java Foundation Bi Xiangdong day02

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.