* About: method overloading

Method overloading application scenario: I want to write a function, and this function is similar to, or are the same, but only need the caller pass different parameters, in essence, internal basic/do exactly the same way, so I just need to expose the same methods to the caller name is ok, so, no matter who to call a method. (This is a programming idea), there are many overloads of this method in Java library functions, such as the print function.

Note: Method return values do not affect method overloading (as shown below)

void method(String name,int age)
{
     System.out.println("Hello"); 
} 
int method(String name,int age)
{ 
    System.out.println("Hello");
    return 12; 
} 
Copy the code

I can’t do that, and I’ll get an error, because in the main function, I can accept the return value without a variable, so when I call the function, the parameters are the same, and the system doesn’t know which method I’m calling.

* About: the memory structure of arrays

Int [] a = {} Memory allocates space for it. If it is new, space will be allocated for it. But there are no elements in it, so the array is out of bounds. If I take a, what I get is an address.

Arrays. ToString is a method of the Java built-in Arrays class, because Arrays cannot be exported directly, you need to convert them to strings. Arrays.