Static {} (static block) is executed only once when the class is loaded. It is generally used to initialize static variables and call static methods, next we will discuss in detail the features and applications of this statement block.1. During a
Calling a non-static method is the first way to call a static method to get the Java class object to call and then by calling
Minfo.env->callvoidmethod (Activityobj, Minfo.methodid); method takes the object and the method and arguments to invoke,
7-1, Constructors-Overview
1, Features:
(1) The function name is the same as the class name.
(2) The return value type is not defined.
(3) There is no specific return value.
2, constructors
Constructors are constructs that create objects that are
Generally speaking, when you create a class, you are describing the appearance and behavior of the object of that class. Unless you create the object of that class with new, you don't actually get anything. When you create an object with new, the
The static keyword declares that a property or method is related to a class, not a particular instance of a class, and therefore such a property or method is also called a class property or a class method.
If access control permission allows, you
Detailed explanation of converting to the static {} statement block in java, javastatic
Address: http://blog.csdn.net/lubiaopan/article/details/4802430 thanks to the original author!
Static {} (static block) is executed only once when the class
Disclaimer: reprinted, please indicate the source
Static {} (static block) is executed only once when the class is loaded. It is generally used to initialize static variables and call static methods, next we will discuss in detail the features and
Original address: http://blog.csdn.NET/lubiaopan/article/details/4802430 thank the original author!static{} (that is, the static block), will be executed when the class is loaded and will only be executed once, generally used to initialize static
In the introduction of
pseudo-StaticAfter the addition of two nouns, parsing static URLs: pure static HTML document, can use filetype:htm query to the Web page, dynamic URL: Content in the database, according to the requirements to display content,
static{} (that is, the static block), will be executed when the class is loaded and will only be executed once , generally used to initialize static variables and call static methods, the following is a detailed discussion of the statement block
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.