"Crazy Java Handout" reading notes (i)

Source: Internet
Author: User

Object-oriented has three basic characteristics: encapsulation (encapsulation), Inheritance (inheritance), and polymorphism (polymorphism).

Inheritance is an important means of object-oriented software reuse, when subclasses inherit the parent class and subclass as a special parent class, they get all the properties and methods of the parent class.

Encapsulation refers to hiding the implementation details of an object, and then exposing the object's functionality through some common methods;

Polymorphism refers to a child class object that can be directly assigned to a reference to the parent class, but the runtime still behaves as a subclass, which means that objects of the same type may behave differently at run time.


In Java, everything is an object except for 8 basic data types.


A null reference (NULL) can only be converted to a reference type and cannot be converted to a base type, so do not assign a null value to a variable of the base data type.


Because Java floating-point numbers use the scientific notation of binary data to represent floating-point numbers, it may not be possible to accurately identify a floating-point number. If you need to accurately identify a floating-point number, consider using the BigDecimal class.


All the data in the bottom of the computer are in binary form, the original code is to directly convert a decimal number into a binary number. But the computer saves all integers in the form of a complement. The rule of complement is: the original code and the complement of the whole number are identical, the complement of the negative is its inverse code plus 1, the inverse code is the original code bitwise negation, the highest bit (sign bit) unchanged.


There are two issues to note when using a switch statement:

Expressions (expression) after a 1.switch statement can only be of type int, char, byte, short, because the latter three types can be converted automatically to int;

2. If you omit the trap caused by the break after the case.


An array is also a data type, which is itself a reference type.


When a method executes, each method builds its own memory stack, and the variables defined in the method are placed in the stack memory, and the memory stack of the method is destroyed as the execution of the method ends, so all local variables defined in the method are stored in the stack memory.



"Crazy Java Handout" reading notes (i)

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.