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)