Basic knowledge of Java ignored (II.)

Source: Internet
Author: User

14. The contents of the string cannot be changed, and the character value of a subscript cannot be modified. The "+" connection between strings is pointed to by the reference address in the stack that modifies the variable by "disconnect-reconnect."

15. When an object is instantiated as an argument to an array, class (which can have a string in a property of a class), the value of the original main method changes when the method changes it.

When the string class variable is a parameter, the value is modified in the method, and the original string value does not change, because the value of the string type is changed by referring to the heap address, and the original heap content exists.

16. This keyword: Represents a property in a class, invokes a method, or constructs a method (placed in the first row), representing the current object.

17. This accesses the properties in this class, the methods in this class, or the properties or methods in the parent class if none is present in this class.

18. Memory areas commonly used in Java:

A stack of memory space: the name of the object where it was saved (or the address where the heap memory was saved)

b Heap Memory Space: Save the actual contents of each object

C Global Data area: Save properties of static type

D Global Code: Save All Method definitions

19. A method other than a static declaration can invoke a property or method of a static declaration, but a method or property declared by a static can only be invoked by the methods or properties of the static declaration.

20, System.exit (1) means to exit the system, the exit () method adds a number other than 0 to exit the system.

21. Code BLOCK: You can access the properties (including private) or methods in this class by means of a section of code enclosed in {}.

Common code blocks:

Basic knowledge of Java ignored (II.)

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.