Java Learning mentality

Source: Internet
Author: User

Array naming, int[] Mingzi = new INT[10];

Co-management: Mingzi = mingzi1;//controls the MINGZI1 array at the same time (but none of them have mingzi1 arrays, just controls, like pointers. )

The function pass of a Java array is a "takeover", similar to a pointer, and can change the value of an array, returning the original array name to continue taking over.

When defining a class, within the class, use This.field to specify the member variable within the class's function.

Overload

Initialize the value of the pass, Constructer

The member function calls another member function to write the name directly.

The lifetime of a member variable within a class is longer than the lifetime of a local variable within a class function

Class, a local variable with the same name in the class function overrides the member variable and then resumes from the class function.

The class function return type can be a class name.

class, static functions can only invoke static variables or other static functions, while non-static functions may invoke all types of variables or functions.

Static: Multiple objects control a variable at the same time, similar to the relationship between multiple "same" array names.

Java Learning mentality

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.