03 Classroom Questions

Source: Internet
Author: User

The rules of the AVA field initialization : The default value specified when executing a class member definition, or the initialization block of the class, who executed it before, and the initialization block of the class does not receive any arguments, and is executed when the object of the class is created.

How do I access an instance member of a class in a static method?

A static method or property in a class is not inherently a member of the class, and when the Java virtual machine is loaded into the class, the static objects already have the object, and it is only in this class that " Aliens " , you do not need to instantiate through the class's constructor (constructor) class, rather than a static property or method, where the class's load does not exist, and you need to rely on the instance object of the class to exist after executing the class's constructor. So when a non-static method is called in a static method, the compiler will error (cannot make a static reference to the Non-static method func () from the type a ).

03 Classroom Questions

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.