Santhiya Park Java SE Training Summary (10-16)

Source: Internet
Author: User
Tags java se

Santhiya Park Java SE Training Summary (10-16)
1. Member variables are variables defined in the class, local variables are variables defined in the method, definitions are not initialized, and default values are initialized when the instance (object) is created! However, local variables must be assigned before they are used! When a local variable has the same name as a member variable, the member variable is substituted within the scope of the local variable!
2. New will do three things: to create a heap of memory space for instances of this class, to invoke the new structure of a parameter or a parameterless structure; Returns a reference to an object from the start address of the object in heap memory!
3.java there is only value passing, there is no reference pass for C (to be reviewed), and so on, when the passed argument is the underlying type, the value of the argument is assigned to the parameter of the underlying type, and when the passed argument is a reference type, the address of the object pointed to by the argument is assigned to the parameter, and the parameter So when you make changes to the properties of a parameter pointing to an object in a method, it reacts to the object that the argument points to! Just a person called a different name! For example Zhang San and pretending are this person, Zhang San's hand broken, pretending the hand must also broken, pretending leg broken, Zhang San leg must also broken!
4. Method overloading (overload) is based on the specific parameters to distinguish between the same name Method! The method overloads are not differentiated according to the different return values! With the same call Foobar, and the same parameter type method, the return value of different methods written in the same class, the compiler will error, prompting this is the same method!

Santhiya Park Java SE Training Summary (10-16)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.