Hands-on brain Java jobs

Source: Internet
Author: User

1. Procedures

The first false: Determine the value in S and T, and output false if different

The second false: This method returns True if and only if the class represents a base type

The third true: Determine the value in S and u, the same output true

Finally, all values of size are listed.

Among the problems:

S and T refer to the same object? No

is the original data type? No

2. The original code, complement and counter code of the computer:

1. Original code: The original code notation is a simple representation of the number of machines. The sign bit with 0 for a plus, 1 for the minus, the value is generally expressed in binary form.

2. Complement: The complement of the number of machines can be obtained from the original code. If the number of machines is positive, then the number of the machine is the same as the original code, if the number of machines is negative, then the number of the machine is the complement of its original code (except for the sign bit) to take the inverse, and in no place plus 1 to get .

3. Anti-code: The inverse code of the number of machines can be obtained from the original code. If the number of machines is positive, then the inverse code of the machine number is the same as the original code, if the number of machines is negative, then the counter code of the number of the machine is the original code (except for the sign bit) you get.

Example:[X1] = +1010110(binary)

[X1] Original = 01010110

[X1] complement = 01010110

[X1] Anti- = 01010110

[X2] = -1001010(binary)

[X2] Original = 11001010

[X2] complement = 10110110

[X2] Anti- = 10110101

3. Shielding principle of variable with the same name:

Within a method, you can define a local variable or parameter with the same name as the member variable, at which point the member variable is masked. At this point, if you want to access the member variable, you can access the This keyword through the This keyword to access , this is a reference to the current instance, if you want to access the class variable, can be accessed through the class name.

4. Why is the numeric value of a double type not "mathematically accurate"? N-binary can be understood as: the power of the numerical x cardinality, for example, we are familiar with the decimal number 123.4=1x10²+2x10+3x (10 of the 0 power) +4x (10-1 power); the other binary is the same, such as the binary number 11.01=1x2+1x (2 Power 0) +0+ 1x (2 to 2 power) = 3.25 decimal. a value of type double takes 64bit, or 64 binary numbers, except that the highest bit represents the positive and negative sign, and the lowest bit is bound to have an error with the actual data (unless the actual data is exactly 2 of the n-th square).
For example, for example, to use 4bit to represent decimal 3.26, from high to low to correspond to 2 1,0,-1,-2 power, according to the top of the analysis, should be in the binary number 11.01 (corresponding to the decimal 3.25) and 11.10 (corresponding to the decimal 3.5) between the selection.
in short, we give the value, in most cases need more than 64bit more digits to accurately represent (even need infinity), and the double type of the value of only 64bit, the number of bits behind will definitely bring error, can not get "mathematically accurate" results

5. What is the output of the following code?

Why is there such an output result?

Because the output is a string, the previous one outputs two strings, and the last one represents the output of two shapes with a string.

Hands-on brain Java jobs

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.