Java Fundamentals 4

Source: Internet
Author: User

The classification of constants in Java:

1. Integer constants, 2. Decimal constant 3. Boolean constant 4. Character constants (denoted by single quotation marks, should be able to have one character) 5. String constants (in double quotes, represented by multiple characters) 5.null constants

Computer history: At the very beginning, the computer describes data by means of electrical signals. A set of 8 electrical signals (8 bits), which is a unit, called the byte (smallest unit of computer-byte)

Decimal to binary: is constantly divided by 2, take the remainder, and then the remainder from the bottom up to write, OK. The binary of 6 is 110

Binary to decimal: is multiplied by the power of 2, the binary 110, converted to a decimal: 0*2 (0) +1*2 (1) +1*2 (2) = 6 from right to left, and power is incremented sequentially

Octal: Front plus 0----0125

Hex: 0x in front,----0x55

Negative number binary: is positive binary negation +1 (00000001), negative binary highest bit is 1; bits are 1, the corresponding decimal is-1.

Java Fundamentals 4

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.