I. Important features of java
1: Data abstraction principle: the user code cannot access the implementation details of the classes in use. If Class A uses Class B, the method A cannot access the fields of Class B, b's field can only be accessed using B's method.
2: open/close principle: each class should be developed (extended by inheritance) and closed (stable for existing applications)
3: All other public classes can be seen.
Protected is only applicable to this class, subclass, and other classes in the package. When it is not written by default, it is of the protected type.
Private can only be used by this class. Subclass can only be inherited and cannot be used (only visible and unavailable)
4: abstract class: class with at least one abstract Method
Abstract Fang fa uses abstract As the qualifier. abstract methods do not have specific method definitions, so they cannot be instantiated.
An interface is a set of abstract methods and constants. There are no definite methods and no fields in the interface. All methods in the interface are abstract methods and are public.
If a class only implements some methods of the interface, the class must be declared as an abstract class.
5: some important conversion formulas
Int I;
Integer myInt;
String s;
I = myInt. intValue ();
I = Integer. parseInt (s );
MyInt = new Integer (s );
MyInt = new Integer (I );
S = Integer. toString (I );
S = myInt. toString ();
6: There are two types of variables in java: the original variables and the reference variables. The original variables Save the values of the original data (byte, short, int, long, float, double, char, boolean ),
Reference variables save references to objects.
This article is from cainiao Park"