Method OverLoad: Multiple methods have the same name but different argument lists

Method overload factor correlation (variable) : 1, different number of parameters 2, different parameter types 3, different sequence of parameter types irrelevant: 1, independent of the name of the parameter 2, independent of the method return value

    public  static int sun(int a , int b){
        return a + b;
    }
    public  static int sun(int a , int b , int c){
        return a + b + c;
    }
    public  static int sun(int a , int b , int c , int d){
        return a + b + c + d;
    }
Copy the code

Array: Can hold multiple data at the same time

Array features: 1. Array is a reference data type. 2. Array can hold multiple data, but the type must be the sameCopy the code
Array initialization1, int [] which =new int[20];  // Dynamic initialization
2, int [] which =new int[] {2.10.22.29};  // Static initializationWhen an array is dynamically initialized, its elements automatically have a default value as follows:1, integer type: default0
2Floating point type: default0.0
3, character type: default'\u0000'
4Boolean type: defaultfalse
5, reference type: defaultnull
Copy the code

JAVA memory is divided into5A part of

1Local variables: parameters in a method, or scope of internal variables of method weight: once out of scope, it is immediately released in Stack memory2Heap: whatevernewEverything that comes out is stored in the heap. Data in the heap has an address value:16The data in the base heap memory has default values. Rules (see default rules above)3Method Area: storage.classRelated information, including method information. 4. Local method stack (Native Method Stack) : Related to the operating systempc Register) :CPUrelatedCopy the code