Static variables for classes and classes

Source: Internet
Author: User

Static properties of classes and classes

Static variable: A member variable that is "static" decorated under a class.

Program compilation process: Java as an example: Java is a static language, after we have written the Java program, the main is to write. java files, The compiler then compiles to a. class file and then parses and executes the. class file through a different platform's JVM, so that Java is a cross-platform language, or Java has a different platform JVM to achieve cross-platform.

Class is created: When the class is loaded it is classloader to load the class, and if the class inherits other classes it needs to first load the parent class and then load the current class. While loading a class, you need to initialize the static initialization block, and then load the static method and static members. The static property is created at this time. The class is then destroyed when the virtual machine terminates (system.exit (0);). This is the life cycle of class and static properties.

Static variables for classes and classes

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.