java method overload and overriding

java method's overload
Method overloading the range: a class inside
  How to determine the method of overload:
         1, the number of parameters in different ways
         2, different types of method parameters
         3, the number and types of method parameters are equal, their order of different methods are also considered heavy
  Note: The method returns the parameter type, and not as a way to judge whether the overload factor.
java method's overriding
  Overriding will occur: Child extends Father this relation
  How to determine whether the rewrite?:
      If the child class defines a method with the parent class has the same name and parameters, and the method return value type and the type of exception is thrown their consistency with the parent, we say that the method has been rewritten (Overriding)
      Subclass object using this method is called sub-class definition, it is concerned, the definition of the parent class as being "shielded" the.
      Other: static, native and synchronized methods can not be overriding.

你可能感兴趣的:(java)