Thinking in Java Learning Notes (i)

Source: Internet
Author: User

For undergraduate non-computer majors of cross-test, programming ability is still a certain lack of. Recently started contacting a Java engineering development (compile-and-test-related) project, and had little contact with Java before. Then began to learn the evil complement, record the two days reading the understanding of a few things, the most of their own study notes it.

1. Initialization loading order in Java:

When a static variable or method is decorated in a function with the static keyword, when the function is first instantiated or called (calling a static method), the static variable or method is initialized, followed by the construction method (if any), and then the remaining method is called.

A static variable or method is initialized only the first time it is called or the first class instance session, and subsequent calls are no longer initialized with the static variable.

2. The comparison between the second and C languages of arrays in Java

1) The assignment of an array in Java is simply an assignment of a reference (which can be understood as a pointer), after the assignment, two arrays point to the same block (the address of the array), the elements in the array are changed with one of the array names, and the elements of the array that the other array names point to change.

2) The assignment of array in C language is the assignment between two different regions (different array addresses), and it is not possible to assign values to arrays by connecting the array names directly with an equal sign, assigning the elements within the array to one another. (When changing an array of elements within an array, the other array is not changed)

  

Thinking in Java Learning Notes (i)

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.