Basic knowledge of object-oriented

 1, String statement of an address, when you change its value, instead of re-assign to it, but to re-apply for an address. It is to say: you are applying another variable.
       String String is not change. The StringBuffer variable string
       the string is the first addition adding to open space.
    
 2, super and this is different:
       this can be used to represent the "current object", available return to return. For super, there is no return super; such statements.
       super primarily to: access the parent class property in a subclass or call methods in the parent class in subclasses introduced a keyword.
       
 3, Package:
        1, the variable private to prevent any person directly modify, read, prevent unsafe value, the control visitors permissions
        2, provides get and set methods

 4, use this constructor calls:
        1, must write in the constructor
        2, must be written in the first line
    
 5, ArrayList underlying implementation is an array, thread-safe, high efficiency, fast query, modify, insert and delete slow
        LinkedList underlying implementation is the list, thread-safe, high-efficiency, slow query, modify, insert and delete quick
        Vector underlying array is implemented, thread-safe, low efficiency
    
 6, the specific time of uncertainty in the business of the parent class implementation, and all this will have a specific business methods, use abstract methods.
        Abstract method has no method body.
        Abstract class defines: an ordinary method combined with modified abstract class, then such is an abstract class.
        If a class has only one abstract method, the class must be abstract.
        Abstract parent class must be the class, an abstract class that can not be instantiated (new class name ()).
        If a class inherits an abstract class, it must implement the abstract methods of the parent class, or define your own as an abstract class.
        
 7, with final modifications before the variable that indicates constants, instance variables can be assigned in the constructor, class variables (static variables) can only be initiated at the time of creation.
        When define methods and classes, final and abstract can not be used
            of The class the AbstractClass CAN BE either abstract or Final, Not both
            of The abstract Method skill in type the AbstractClass CAN only SET A visibility modifier, One of public or protected
        Final write a separate class front , the class can not be inherited, that is not a subclass.
        The method used in the final front, showing the class can not be rewritten.
        At The final of Can not the override · Method, from AbstractClass
        final modification of a variable, there are a lot of stories, such as can not be changed, and so on, accurate description is that when a final variable is modified when the variable is assigned only one chance
        
 8, overloading: in the same class, the same method name, multiple methods different argument lists, and return types and modifiers unrelated
        action: the same method can do different things

 9, an interface (not common attributes, constructors, ordinary methods, interfaces are static variables constant)
        only abstract method of the abstract class, an interface can be represented.
        Interface can only contain abstract methods, modifiers for the public, abstract, represent a series of similar actions (method)
        public abstract void RUN ();
        void shoot ();
        default are all public abstract.
        A class implements the interface, the interface must be rewritten in all the methods (except the abstract class)
        interface multiple inheritance.

Guess you like

Origin www.cnblogs.com/lxiaoxuan/p/11106883.html