Java Learning 16th Lesson, Java package, class and other related basic knowledge

Source: Internet
Author: User

1. It is recommended to put the class in the package, do not use the nameless package

2. Recommended package names are made up of lowercase words, not uppercase

3. It is recommended that the name of the package be "inverted by the domain name." The name of the module to ensure uniqueness of the package name

Note: The difference between a class variable and an instance variable, a class method, and an instance method

Adding static to the front is a class variable or class method.

Instance methods can call other methods in the class

But class methods can only call other class static methods and cannot invoke instance methods

Class methods only call class variables.

When a class is loaded into memory, instance methods, instance variables are not allocated memory space, and are not created until the object is created.

The face class method allocates the appropriate memory space when the class is loaded into memory.

Java Learning 16th Lesson, Java package, class and other related basic knowledge

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.